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_idstr

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_pathstr, default=”model”

The artifact path within the run where the model is stored.

dst_pathstr | 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.

Returns:
modelmlflow.pyfunc.PyFuncModel | MMM

The loaded MLflow PyFuncModel or MMM model.

Examples

# Load model using run_id
model = load_mmm(run_id="your_run_id", full_model=True, keep_idata=True)