BaseGammaGammaModel#
- class pymc_marketing.clv.models.gamma_gamma.BaseGammaGammaModel(data, *, model_config=None, sampler_config=None, non_distributions=None)[source]#
Base class for Gamma-Gamma models.
Methods
BaseGammaGammaModel.__init__(data, *[, ...])Initialize model configuration and sampler configuration for the model.
Convert the model configuration and sampler configuration from the attributes to keyword arguments.
BaseGammaGammaModel.build_model(X, y, **kwargs)Create an instance of
pm.Modelbased on provided data and model_config.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([fit_method])Infer model posterior.
BaseGammaGammaModel.fit_summary(**kwargs)Compute the summary of the fit result.
BaseGammaGammaModel.get_params([deep])Get all the model parameters needed to instantiate a copy of the model, not including training data.
BaseGammaGammaModel.load(fname)Create a ModelBuilder instance from a file.
BaseGammaGammaModel.predict(X_pred[, ...])Use a model to predict on unseen data and return point prediction of all the samples.
Generate posterior predictive samples on unseen data.
BaseGammaGammaModel.predict_proba(X_pred[, ...])Alias for
predict_posterior, for consistency with scikit-learn probabilistic estimators.Sample from the model's posterior predictive distribution.
Sample from the model's prior predictive distribution.
BaseGammaGammaModel.save(fname)Save the model's inference data to a file.
BaseGammaGammaModel.set_idata_attrs([idata])Set attributes on an InferenceData object.
BaseGammaGammaModel.set_params(**params)Set all the model parameters needed to instantiate the model, not including training data.
BaseGammaGammaModel.thin_fit_result(keep_every)Return a copy of the model with a thinned fit result.
Attributes
Xdefault_model_configReturn a class default configuration dictionary.
default_sampler_configDefault sampler configuration.
fit_resultGet the fit result.
idGenerate a unique hash value for the model.
output_varOutput variable of the model.
versiony