DeferredFactory#
- class pymc_marketing.serialization.DeferredFactory(**data)[source]#
Serializable recipe for creating objects with non-serializable state.
Instead of storing a live object (e.g., a Prior with PyTensor tensor parameters), store the factory function path and its scalar arguments. Call
resolve()at build_model() time to create the actual object.Methods
DeferredFactory.__init__(**data)Create a new model by parsing and validating input data from keyword arguments.
DeferredFactory.construct([_fields_set])DeferredFactory.copy(*[, include, exclude, ...])Returns a copy of the model.
DeferredFactory.dict(*[, include, exclude, ...])Reconstruct a DeferredFactory from a dict.
DeferredFactory.json(*[, include, exclude, ...])Compute the class name for parametrizations of generic classes.
DeferredFactory.parse_file(path, *[, ...])DeferredFactory.parse_raw(b, *[, ...])Import the factory function and call it with kwargs.
DeferredFactory.schema([by_alias, ref_template])DeferredFactory.schema_json(*[, by_alias, ...])Serialize the deferred factory to a dict.
DeferredFactory.update_forward_refs(**localns)DeferredFactory.validate(value)Attributes
model_computed_fieldsmodel_configConfiguration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].model_extraGet extra fields set during validation.
model_fieldsmodel_fields_setReturns the set of fields that have been explicitly set on this model instance.
factorykwargs