-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'vaqxai-pylint' into suml-docker
- Loading branch information
Showing
10 changed files
with
49 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ conda activate penguins-env | |
3. Run the project | ||
|
||
``` | ||
kedro run | ||
kedro run | ||
``` | ||
|
||
## PyCharm Setup | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
from typing import Dict, Tuple | ||
"""Nodes for the modeling pipeline.""" | ||
from typing import Tuple | ||
|
||
import mlflow | ||
import pandas as pd | ||
from autogluon.tabular import TabularPredictor | ||
from sklearn.model_selection import train_test_split | ||
|
||
|
||
def split_data(data: pd.DataFrame, parameters: Dict) -> Tuple: | ||
def split_data(data: pd.DataFrame) -> Tuple: | ||
"""Split data into train and test sets.""" | ||
train, test = train_test_split(data, test_size=0.2) | ||
return test, test | ||
return train, test | ||
|
||
|
||
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) | ||
y_pred = classificator.evaluate(test) | ||
classificator.evaluate(test) | ||
for key, value in classificator.fit_summary()["model_performance"].items(): | ||
mlflow.log_metric(f"{key}_accuracy", value) | ||
return classificator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters