incalculable-honey-94159
11/13/2023, 1:30 PMtall-lock-23197
freezing-airport-6809
hallowed-flower-25242
11/14/2023, 12:49 PMtall-lock-23197
--remote
to the pyflyte run
command?hallowed-flower-25242
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!hallowed-flower-25242
11/14/2023, 1:57 PM❯ 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.
incalculable-honey-94159
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\'"'
incalculable-honey-94159
11/14/2023, 4:40 PMtall-lock-23197
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?incalculable-honey-94159
11/15/2023, 1:15 PMtall-lock-23197