Track MLflow integration for the BassModel.
What already works (free lunch)
pymc_marketing.mlflow.autolog() patches pm.sample, which BassModel.fit() calls internally. This gives us:
- Version logging (PyMC-Marketing, PyMC, ArviZ versions)
- Model diagnostics (divergences, sampling time, draws, chains)
- ArviZ summary table
- Model graph PDF
- Metadata of inputs
- InferenceData artifact
No Bass-specific code needed for any of the above.
What would need explicit support
This should build off plotting methods on BassModel and an updated notebook. The workflow would be:
import mlflow
import pymc_marketing.mlflow
pymc_marketing.mlflow.autolog(log_bass=True)
model = BassModel()
with mlflow.start_run():
idata = model.fit(data=y)
pp = model.sample_posterior_predictive(X=future)
fig = model.plot_adoption_curve()
mlflow.log_figure(fig, "adoption_curve.png")
fig = model.plot_decomposition()
mlflow.log_figure(fig, "decomposition.png")
Specific additions needed in pymc_marketing/mlflow.py:
- Patch
BassModel.fit — logs model config (priors for m, p, q, likelihood), model type, and saves idata.nc (pattern already used by MMM and CLV)
log_bass_configuration helper — logs the prior configuration for reproducibility
Dependencies
- BassModel plotting methods (for
mlflow.log_figure)
- Updated notebook showcasing the full MLflow workflow
Track MLflow integration for the BassModel.
What already works (free lunch)
pymc_marketing.mlflow.autolog()patchespm.sample, whichBassModel.fit()calls internally. This gives us:No Bass-specific code needed for any of the above.
What would need explicit support
This should build off plotting methods on
BassModeland an updated notebook. The workflow would be:Specific additions needed in
pymc_marketing/mlflow.py:BassModel.fit— logs model config (priors form,p,q,likelihood), model type, and savesidata.nc(pattern already used by MMM and CLV)log_bass_configurationhelper — logs the prior configuration for reproducibilityDependencies
mlflow.log_figure)