CLVModel#
- class pymc_marketing.clv.models.basic.CLVModel(data, *, model_config=None, sampler_config=None, non_distributions=None)[source]#
CLV Model base class.
Methods
CLVModel.__init__(data, *[, model_config, ...])Initialize model configuration and sampler configuration for the model.
Convert the model configuration and sampler configuration from the attributes to keyword arguments.
CLVModel.build_from_idata(idata)Build model from the InferenceData object.
CLVModel.build_model(X, y, **kwargs)Create an instance of
pm.Modelbased on provided data and model_config.CLVModel.create_fit_data(X, y)Create the fit_data group based on the input data.
Create attributes for the inference data.
CLVModel.fit([method, fit_method])Infer model posterior.
CLVModel.fit_summary(**kwargs)Compute the summary of the fit result.
CLVModel.graphviz(**kwargs)Get the graphviz representation of the model.
CLVModel.load(fname)Create a ModelBuilder instance from a file.
CLVModel.load_from_idata(idata)Create a ModelBuilder instance from an InferenceData object.
Perform transformation on the model after sampling.
CLVModel.predict([X, extend_idata])Use a model to predict on unseen data and return point prediction of all the samples.
CLVModel.predict_posterior([X, ...])Generate posterior predictive samples on unseen data.
CLVModel.predict_proba([X, extend_idata, ...])Alias for
predict_posterior, for consistency with scikit-learn probabilistic estimators.CLVModel.sample_posterior_predictive([X, ...])Sample from the model's posterior predictive distribution.
CLVModel.sample_prior_predictive([X, y, ...])Sample from the model's prior predictive distribution.
CLVModel.save(fname)Save the model's inference data to a file.
CLVModel.set_idata_attrs([idata])Set attributes on an InferenceData object.
CLVModel.table(**model_table_kwargs)Get the summary table of the model.
CLVModel.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 posterior fit_result.
idGenerate a unique hash value for the model.
output_varOutput variable of the model.
posteriorposterior_predictivepredictionspriorprior_predictiveversiony