ÎncepețiÎncepe gratuit

Logging tuned models

You have been experimenting with different model hyperparameters and need to log your latest round of experiment results to MLflow, let's do it!

Acest exercițiu face parte din cursul

Designing Forecasting Pipelines for Production

Vezi cursul

Instrucțiuni pentru exercițiu

  • Set the experiment name as "hyperparameter_tuning".
  • Loop over the index and rows of df.
  • Start an MLflow run.

Exercițiu interactiv practic

Încearcă acest exercițiu completând acest cod de exemplu.

# Set the experiment name
experiment_name = "____"
experiment_id = mlflow.create_experiment(experiment_name)

# Loop through the DataFrame
for idx, row in df.____():
  # Start a run
  with mlflow.____(experiment_id=____):
    model_params = ml_models[row["model_label"]].get_params()
    model_params["model_name"] = row["model_name"]
    model_params["model_label"] = row["model_label"]
    model_params["partition"] = row["partition"]
    model_params["lags"] = list(range(1, 24))
    model_params["date_features"] = ["month", "day", "dayofweek", "week", "hour"]
    mlflow.log_params(model_params)
    mlflow.log_metric("mape", row["mape"])
    mlflow.log_metric("rmse", row["rmse"])
Editează și rulează codul