You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am trying to log the sklearn pipeline in the model attribute to MLFLOW on databricks with the silverkite template. See the code snippet below. When attrempting to log the sklearn.pipeline that is in the model attribute of the "greykite.framework.pipeline.pipeline.ForecastResult" object I recieve an error message stating: NotImplementedError: Sorry, pickling not yet supported. See https://github.com/pydata/patsy/issues/26 if you want to help.
Any idea on how I can log this model with the silverkite template to MLFLOW?
fromcollectionsimportdefaultdictimportwarningswarnings.filterwarnings("ignore")
importpandasaspdimportplotlyfromgreykite.common.data_loaderimportDataLoaderfromgreykite.framework.templates.autogen.forecast_configimportForecastConfigfromgreykite.framework.templates.autogen.forecast_configimportMetadataParamfromgreykite.framework.templates.forecasterimportForecasterfromgreykite.framework.templates.model_templatesimportModelTemplateEnumfromgreykite.framework.utils.result_summaryimportsummarize_grid_search_resultsimportmlflow# Loads dataset into pandas DataFramedl=DataLoader()
df=dl.load_peyton_manning()
# specify dataset informationmetadata=MetadataParam(
time_col="ts", # name of the time column ("date" in example above)value_col="y", # name of the value column ("sessions" in example above)freq="D"# "H" for hourly, "D" for daily, "W" for weekly, etc.# Any format accepted by `pandas.date_range`
)
forecaster=Forecaster() # Creates forecasts and stores the resultresult=forecaster.run_forecast_config( # result is also stored as `forecaster.forecast_result`.df=df,
config=ForecastConfig(
model_template=ModelTemplateEnum.SILVERKITE.name,
forecast_horizon=365, # forecasts 365 steps aheadcoverage=0.95, # 95% prediction intervalsmetadata_param=metadata
)
)
mlflow.sklearn.log_model(result.model, "model")
I'd like to add that if I change if I change the model_template from ModelTemplateEnum.SILVERKITE.name to ModelTemplateEnum.PROPHET.name the code works fine and I am able to log the model and read the model just fine.
Any advice on how to utlize MLFLLOW with the silverkite template?
The text was updated successfully, but these errors were encountered:
ikegwukc
changed the title
MLFLOW support
MLFLOW support for the SilverKite Algorithm
Jun 27, 2023
Long story short, the Silverkite template is tricky to serialize, due to the internal use of patsy. On the other hand, Prophet is pickable.
To log model artifacts to mlflow using the Silverkite template, you can dump them in a local path (using forecaster.dump_forecast_result), then the whole path can be logged to mlflow via mlflow.log_artifact.
Beware that forecaster.dump_forecast_result, as far as I know, does not work on Windows.
More info on model storing and loading are available here.
Hello, I am trying to log the sklearn pipeline in the model attribute to MLFLOW on databricks with the silverkite template. See the code snippet below. When attrempting to log the sklearn.pipeline that is in the model attribute of the "greykite.framework.pipeline.pipeline.ForecastResult" object I recieve an error message stating:
NotImplementedError: Sorry, pickling not yet supported. See https://github.com/pydata/patsy/issues/26 if you want to help.
Any idea on how I can log this model with the silverkite template to MLFLOW?
I'd like to add that if I change if I change the model_template from
ModelTemplateEnum.SILVERKITE.name
toModelTemplateEnum.PROPHET.name
the code works fine and I am able to log the model and read the model just fine.Any advice on how to utlize MLFLLOW with the silverkite template?
The text was updated successfully, but these errors were encountered: