ModelBuilder#

class pymc_marketing.model_builder.ModelBuilder(data, model_config=None, sampler_config=None)[source]#

ModelBuilder that takes data at initialization.

Methods

ModelBuilder.__init__(data[, model_config, ...])

Initialize model configuration and sampler configuration for the model.

ModelBuilder.attrs_to_init_kwargs(attrs)

Convert the model configuration and sampler configuration from the attributes to keyword arguments.

ModelBuilder.build_from_idata(idata)

Build the model from the InferenceData object.

ModelBuilder.build_model(**kwargs)

Create an instance of pm.Model based on provided data and model_config.

ModelBuilder.create_fit_data()

Create the fit_data group based on the input data.

ModelBuilder.create_idata_attrs()

Create attributes for the inference data.

ModelBuilder.fit([progressbar, random_seed])

Fit a model using the data passed as a parameter.

ModelBuilder.graphviz(**kwargs)

Get the graphviz representation of the model.

ModelBuilder.idata_to_init_kwargs(idata)

Convert the model configuration and sampler configuration from the InferenceData to keyword arguments.

ModelBuilder.load(fname[, check])

Create a ModelBuilder instance from a file.

ModelBuilder.load_from_idata(idata[, check])

Create a ModelBuilder instance from an InferenceData object.

ModelBuilder.save(fname, **kwargs)

Save the model's inference data to a file.

ModelBuilder.set_idata_attrs([idata])

Set attributes on an InferenceData object.

Attributes

default_model_config

Return a class default configuration dictionary.

default_sampler_config

Return a class default sampler configuration dictionary.

fit_result

Get the posterior fit_result.

id

Generate a unique hash value for the model.

posterior

posterior_predictive

predictions

prior

prior_predictive

version

idata

sampler_config

model_config