InferenceDataGroupSchema#
- pydantic model pymc_marketing.data.idata.schema.InferenceDataGroupSchema[source]#
Schema for a single InferenceData group.
Validates that a group exists (if required) and contains expected variables with correct structure.
- Parameters:
- name
Literal Group name (e.g., “posterior”, “constant_data”)
- requiredbool, default
True Whether this group must be present
- variables
dictofstrtoVariableSchema Expected variables in this group
- name
Examples
>>> schema = InferenceDataGroupSchema( ... name="posterior", ... required=True, ... variables={ ... "channel_contribution": VariableSchema( ... name="channel_contribution", ... dims=("date", "channel"), ... dtype="float64", ... ), ... }, ... ) >>> errors = schema.validate_group(idata)
Methods
Create a new model by parsing and validating input data from keyword arguments.
Validate group exists and contains expected variables.
- field name: Literal['posterior', 'prior', 'constant_data', 'observed_data', 'fit_data', 'posterior_predictive', 'prior_predictive', 'sample_stats', 'posterior_predictive_constant_data'] [Required][source]#
- field variables: dict[str, VariableSchema] [Optional][source]#