load_model#
- load_model(model_uri, dst_path=None)[source]#
Load a aeon model from a local file or a run.
- Parameters:
- model_uristr
The location, in URI format, of the MLflow model. For example:
/Users/me/path/to/local/model
relative/path/to/local/model
s3://my_bucket/path/to/model
runs:/<mlflow_run_id>/run-relative/path/to/model
mlflow-artifacts:/path/to/model
For more information about supported URI schemes, see Referencing Artifacts.
- dst_pathstr, optional (default=None)
The local filesystem path to which to download the model artifact.This directory must already exist. If unspecified, a local output path will be created.
- Returns:
- A aeon model instance.
References
Examples
>>> from aeon.datasets import load_airline >>> from aeon.forecasting.arima import ARIMA >>> from aeon.utils import mlflow_aeon >>> y = load_airline() >>> forecaster = ARIMA( ... order=(1, 1, 0), ... seasonal_order=(0, 1, 0, 12), ... suppress_warnings=True) >>> forecaster.fit(y) ARIMA(...) >>> model_path = "model" >>> mlflow_aeon.save_model( ... estimator=forecaster, ... path=model_path) >>> loaded_model = mlflow_aeon.load_model(model_uri=model_path)