Max Mathys
11/13/2023, 1:30 PMSamhita Alla
Ketan (kumare3)
CP
11/14/2023, 12:49 PMSamhita Alla
--remote
to the pyflyte run
command?CP
11/14/2023, 1:55 PMpyflyte run example_fyte.py training_workflow --hyperparameters '{"C": 0.1}'
, as in the tutorial, but will give it a go!❯ pyflyte run --remote example_fyte.py training_workflow --hyperparameters '{"C": 0.1}'
Running Execution on Remote.
[âś”] Go to <http://localhost:30080/console/projects/flytesnacks/domains/development/executions/f6b8aabfdcb2a42639ab> to see execution in the console.
Indeed, seems to be working now!
Without --rmeote
I was missing the [âś”] Go to <http://localhost:30080/console/projects/flytesnacks/domains/development/executions/f6b8aabfdcb2a42639ab> to see execution in the console.
Max Mathys
11/14/2023, 4:40 PMFlyteScopedUserException: 'target'
Failed with Unknown Exception <class 'KeyError'> Reason: 'Encountered error while executing workflow \'example.training_workflow\':\n "Error encountered while executing \'training_workflow\':\\n \'target\'"'
'Encountered error while executing workflow \'example.training_workflow\':\n "Error encountered while executing \'training_workflow\':\\n \'target\'"'
Samhita Alla
import pandas as pd
from sklearn.datasets import load_wine
from sklearn.linear_model import LogisticRegression
import flytekit.extras.sklearn
from flytekit import task, workflow
@task
def get_data() -> pd.DataFrame:
"""Get the wine dataset."""
return load_wine(as_frame=True).frame
@task
def process_data(data: pd.DataFrame) -> pd.DataFrame:
"""Simplify the task from a 3-class to a binary classification problem."""
return data.assign(target=lambda x: x["target"].where(x["target"] == 0, 1))
@task
def train_model(data: pd.DataFrame, hyperparameters: dict) -> LogisticRegression:
"""Train a model on the wine dataset."""
features = data.drop("target", axis="columns")
target = data["target"]
return LogisticRegression(max_iter=3000, **hyperparameters).fit(features, target)
what's the python version?Max Mathys
11/15/2023, 1:15 PMSamhita Alla