load_mmm#
- pymc_marketing.mlflow.load_mmm(run_id, full_model=False, keep_idata=False, artifact_path='model', dst_path=None)[source]#
Load a PyMC-Marketing MMM model from MLflow.
Can either load the full model including the InferenceData, or just the lighter PyFuncModel version.
- Parameters:
- run_id
str
The MLflow run ID from which to load the model.
- full_modelbool, default=True
If True, load the full MMM model including the InferenceData.
- keep_idatabool, default=False
If True, keep the downloaded InferenceData saved locally.
- artifact_path
str
, default=”model” The artifact path within the run where the model is stored.
- dst_path
str
|None
, default=None The local destination path where the InferenceData will be downloaded. If None, defaults to “idata_{run_id}” to avoid conflicts when loading multiple models.
- run_id
- Returns:
- model
mlflow.pyfunc.PyFuncModel
|MMM
The loaded MLflow PyFuncModel or MMM model.
- model
Examples
# Load model using run_id model = load_mmm(run_id="your_run_id", full_model=True, keep_idata=True)