BaseGammaGammaModel#
- class pymc_marketing.clv.models.gamma_gamma.BaseGammaGammaModel(*, model_config=None, sampler_config=None, **kwargs)[source]#
Base class for Gamma-Gamma models.
Methods
BaseGammaGammaModel.__init__(*[, ...])Initialize model configuration and sampler configuration for the model.
Convert the model configuration and sampler configuration from the attributes to keyword arguments.
Build the model from the DataTree object.
BaseGammaGammaModel.build_model(**kwargs)Create an instance of
pm.Modelbased on provided data and model_config.Build the
fit_datagroup stored alongside the posterior.Create attributes for the inference data.
Posterior distribution of mean spend values for each customer.
Posterior distribution of mean spend values for new customers.
Compute the average lifetime value for a group of one or more customers.
Compute the expected future mean spend value per customer.
Compute the expected mean spend value for a new customer.
BaseGammaGammaModel.fit([data, method, ...])Infer the model posterior.
BaseGammaGammaModel.fit_summary(**kwargs)Compute the summary of the fit result.
BaseGammaGammaModel.graphviz(**kwargs)Get the graphviz representation of the model.
Create the model configuration and sampler configuration from the DataTree to keyword arguments.
BaseGammaGammaModel.load(fname[, check])Create a ModelBuilder instance from a file.
BaseGammaGammaModel.load_from_idata(idata[, ...])Create a ModelBuilder instance from a DataTree object.
Perform transformation on the model after sampling.
BaseGammaGammaModel.save(fname, **kwargs)Save the model's inference data to a file.
BaseGammaGammaModel.set_idata_attrs([idata])Set attributes on a DataTree object.
BaseGammaGammaModel.table(**model_table_kwargs)Get the summary table of the model.
BaseGammaGammaModel.thin_fit_result(keep_every)Return a copy of the model with a thinned fit result.
Attributes
default_model_configDefault model configuration.
default_sampler_configDefault sampler configuration.
fit_resultGet the posterior fit_result.
idGenerate a unique hash value for the model.
posteriorAccess the 'posterior' group of the DataTree.
posterior_predictiveAccess the 'posterior_predictive' group of the DataTree.
predictionsAccess the 'predictions' group of the DataTree.
priorAccess the 'prior' group of the DataTree.
prior_predictiveAccess the 'prior_predictive' group of the DataTree.
versionidatasampler_configmodel_configmodelis_fitted_