Skip to main content
Run Statsforecast with MLFlow.
MLFlow is an open source experiment tracking system that helps data scientists manage the model lifecycle from experimentation to production. An MLFlow integration for statsforecast is available in the MLFlow library that contains MLFlow support for popular machine learning libraries.
unique_iddsystatic_0
002000-01-0112.07389743
102000-01-0259.73416643
202000-01-03101.26079443
302000-01-04143.98743043
402000-01-05185.32040643
For the next part, mlflow and mlflavors are needed. Install them with:

Model Logging

Viewing Experiment

To view the newly created experiment and logged artifacts open the MLflow UI:

Loading Statsforecast Model

The statsforecast model can be loaded from the MLFlow registry using the mlflow.statsforecast.load_model function and used to generate predictions.
dsAutoARIMAAutoARIMA-lo-90AutoARIMA-hi-90
unique_id
02000-02-1355.89443244.34388067.444984
02000-02-1497.81805486.267502109.368607
02000-02-15146.745422135.194870158.295975
02000-02-16188.888336177.337784200.438904
02000-02-17231.493637219.943085243.044189

Loading Model with pyfunc

Pyfunc is another interface for MLFlow models that has utilities for loading and saving models. This code is equivalent in making predictions as above.
dsAutoARIMAAutoARIMA-lo-90AutoARIMA-hi-90
unique_id
02000-02-1355.89443244.34388067.444984
02000-02-1497.81805486.267502109.368607
02000-02-15146.745422135.194870158.295975
02000-02-16188.888336177.337784200.438904
02000-02-17231.493637219.943085243.044189

Model Serving

This section illustrates an example of serving the pyfunc flavor to a local REST API endpoint and subsequently requesting a prediction from the served model. To serve the model run the command below where you substitute the run id printed during execution training code.
After running this, the code below can be ran to send a request.
dsAutoARIMAAutoARIMA-lo-95AutoARIMA-lo-90AutoARIMA-hi-90AutoARIMA-hi-95
02000-02-13T00:00:0055.89443242.13110044.34388067.44498469.657768
12000-02-14T00:00:0097.81805484.05471886.267502109.368607111.581390
22000-02-15T00:00:00146.745422132.982086135.194870158.295975160.508759
32000-02-16T00:00:00188.888336175.125015177.337784200.438904202.651672
42000-02-17T00:00:00231.493637217.730301219.943085243.044189245.256973