MMM.fit#
- MMM.fit(X, y=None, *, method='mcmc', progressbar=None, random_seed=None, sample_kwargs=None, **kwargs)[source]#
Fit the model and inject cost_per_unit metadata if provided.
Delegates to the parent
fit()and then injects the parsedcost_per_unitDataArray intoidata.constant_data.- Parameters:
- X
pd.DataFrameorxr.Datasetorxr.DataArray Training input samples.
- y
pd.Seriesorxr.DataArrayornp.ndarrayorNone Target values.
- method
str Method used to fit the model. One of
"mcmc","map","demz","advi"or"fullrank_advi".- progressbarbool, optional
Whether to show the progress bar.
- random_seed
RandomState, optional Random seed for reproducibility.
- sample_kwargs
dict, optional Only used by the variational methods; forwarded to
Approximation.sample(e.g.{"draws": 1_000}).- **kwargs
Any Additional keyword arguments passed to the sampler.
- X
- Returns:
xr.DataTreeInference data of the fitted model.