Deployment and MLOps#
This reference lists sktime
integrations with deployment and MLOps solutions.
Currently, sktime
natively supports integration with mlflow
.
See examples/mlflow
for a notebook tutorial.
MLflow#
The mlflow_sktime
module provides an MLflow API for sktime
forecasters.
This module exports sktime
models in the following formats:
- sktime (native) format
This is the main flavor that can be loaded back into sktime, which relies on pickle internally to serialize a model.
- mlflow.pyfunc
Produced for use by generic pyfunc-based deployment tools and batch inference.
The
pyfunc
flavor of the model supports sktime predict methodspredict
,predict_interval
,predict_proba
,predict_quantiles
,predict_var
.The interface for utilizing a sktime model loaded as a
pyfunc
type for generating forecasts requires passing an exogenous regressor as Pandas DataFrame to thepyfunc.predict()
method (an empty DataFrame must be passed if no exogenous regressor is used). The configuration of predict methods and parameter values passed to the predict methods is defined by a dictionary to be saved as an attribute of the fitted sktime model instance. If no prediction configuration is definedpyfunc.predict()
will return output from sktimepredict
method. Note that forpyfunc
flavor the forecasting horizonfh
must be passed to the fit method.Predict methods and parameter values for
pyfunc
flavor can be defined in two ways:Dict[str, dict]
if parameter values are passed topyfunc.predict()
, for example{"predict_method": {"predict": {}, "predict_interval": {"coverage": [0.1, 0.9]}}
.Dict[str, list]
, with default parameters in predict method, for example{"predict_method": ["predict", "predict_interval"}
(Note: when includingpredict_proba
method the former approach must be followed asquantiles
parameter has to be provided by the user). If no prediction config is definedpyfunc.predict()
will return output from sktimepredict()
method.
|
Create list of default pip requirements for MLflow Models. |
|
Return default Conda environment for MLflow Models. |
|
Save a sktime model to a path on the local file system. |
|
Log a sktime model as an MLflow artifact for the current run. |
|
Load a sktime model from a local file or a run. |