Skip to content

Commit

Permalink
naprawa błędów
Browse files Browse the repository at this point in the history
  • Loading branch information
s19568 committed Jan 23, 2024
1 parent 6758bae commit a67076d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/penguins/pipelines/modeling/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ def split_data(data: pd.DataFrame) -> Tuple:
return train, test


def train_model(train: pd.DataFrame) -> TabularPredictor:
def train_model(train: pd.DataFrame, test: pd.DataFrame) -> TabularPredictor:
"""Train a model on the given data."""
mlflow.set_experiment("penguins")
classificator = TabularPredictor(label="species", log_to_file=False, problem_type="multiclass",
eval_metric="accuracy")
classificator.fit(train, time_limit=120)
classificator.evaluate(test)
for key, value in classificator.fit_summary()["model_performance"].items():
mlflow.log_metric(f"{key}_accuracy", value)
return classificator
2 changes: 1 addition & 1 deletion src/penguins/pipelines/modeling/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def create_pipeline() -> Pipeline:
return pipeline([
node(
func=split_data,
inputs=["model_input_table", "params:model_options"],
inputs=["model_input_table"],
outputs=["train", "test"],
name="split_data_node",
),
Expand Down
1 change: 1 addition & 0 deletions src/penguins/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# Class that manages how configuration is loaded.
from kedro.config import OmegaConfigLoader # noqa: import-outside-toplevel

# CONFIG_LOADER_CLASS = OmegaConfigLoader
ConfigLoaderClass = OmegaConfigLoader
# Keyword arguments to pass to the `CONFIG_LOADER_CLASS` constructor.
# CONFIG_LOADER_ARGS = {
Expand Down

0 comments on commit a67076d

Please sign in to comment.