Skip to content

Commit

Permalink
fix prefect code and add ds bootcamp
Browse files Browse the repository at this point in the history
  • Loading branch information
khuyentran1401 committed Dec 21, 2021
1 parent b6aaedd commit 6b0f17e
Show file tree
Hide file tree
Showing 8 changed files with 9,224 additions and 1,377 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,4 @@ dmypy.json
.pyre/
.config


Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions data_science_tools/prefect_example/data_engineering.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def load_data(path: str) -> pd.DataFrame:
return pd.read_csv(path)


@task(target="{date:%a_%b_%d_%Y_%H:%M:%S}/{task_name}_output", result = LocalResult(dir='data/processed'))
@task(target="{date:%a_%b_%d_%Y_%H-%M-%S}/{task_name}_output", result = LocalResult(dir='data/processed'))
def get_classes(data: pd.DataFrame, target_col: str) -> List[str]:
"""Task for getting the classes from the Iris data set."""
return sorted(data[target_col].unique())
Expand All @@ -27,7 +27,7 @@ def encode_categorical_columns(data: pd.DataFrame, target_col: str) -> pd.DataFr
return pd.get_dummies(data, columns=[target_col], prefix="", prefix_sep="")


@task(log_stdout=True, target="{date:%a_%b_%d_%Y_%H:%M:%S}/{task_name}_output", result = LocalResult(dir='data/processed'))
@task(log_stdout=True, target="{date:%a_%b_%d_%Y_%H-%M-%S}/{task_name}_output", result = LocalResult(dir='data/processed'))
def split_data(data: pd.DataFrame, test_data_ratio: float, classes: list) -> Dict[str, Any]:
"""Task for splitting the classical Iris data set into training and test
sets, each split into features and labels.
Expand Down
Loading

0 comments on commit 6b0f17e

Please sign in to comment.