DeferredFactory#

pydantic model pymc_marketing.serialization.DeferredFactory[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.from_dict(data)

Reconstruct a DeferredFactory from a dict.

DeferredFactory.resolve()

Import the factory function and call it with kwargs.

DeferredFactory.to_dict()

Serialize the deferred factory to a dict.

field factory: str [Required][source]#

Fully-qualified dotted path to the factory function

field kwargs: dict[str, Any] [Optional][source]#

Scalar keyword arguments for the factory