DateIndexedInput#
- class pymc_marketing.mmm.counterfactual.DateIndexedInput(name: str, values: np.ndarray, dtype: str, dims: tuple[str, ...], date_axis: int)[source]#
A date-indexed
pm.Datareplaced by a batched evaluator input.- Parameters:
- name
str Name of the data variable in the model.
- values
np.ndarray Its fitted values, in the model’s own dimension order. Read from the model’s own shared variable rather than from
fit_data, because an effect’s data need not appear there – the funnel example builds the model from anxr.Datasetcarrying the mediator’s inputs, then fits from a frame that does not.- dtype
str Dtype the compiled evaluator expects.
- dims
tupleofstr Its dimensions, in the model’s order.
- date_axis
int Position of
datewithindims. Stored rather than assumed to be zero: an effect is free to declare its data as("country", "date"), and cutting the wrong axis would either raise a misleading length error or, when the two lengths happen to coincide, quietly cut the panel up instead of the calendar.
- name
Methods
DateIndexedInput.__init__(*args, **kwargs)DateIndexedInput.count(value, /)Return number of occurrences of value.
DateIndexedInput.cut(windows)Cut this input into one padded window per period.
DateIndexedInput.index(value[, start, stop])Return first index of value.
Attributes
date_axisAlias for field number 4
dimsAlias for field number 3
dtypeAlias for field number 2
nameAlias for field number 0
valuesAlias for field number 1