ModelTerm#

class pymc_marketing.terms.ModelTerm[source]#

Base class for composable model terms.

Subclass ModelTerm to define reusable PyMC subgraph recipes. Custom terms compose with the built-ins (Parameter, Intercept, Dot, Transform) via +, *, and - and use the same helpers (collect_coords, register_data, build_param, set_data) — no framework changes required. See the module docstring Extending section for the full contract and an example.

Methods

ModelTerm.__init__()

ModelTerm.add_coords(ds)

Add coordinates to the model during register_data.

ModelTerm.create_variable()

Build the term's tensor contribution.

ModelTerm.get_coords(ds)

Return coordinates needed for this term.

ModelTerm.register_data(ds)

Register shared data variables as pmd.Data.

ModelTerm.set_data(ds[, model])

Update shared data variables for out-of-sample prediction.