View source on GitHub
|
Generates a ModelFit proto for a given trained Meridian model.
Inherits From: ModelProcessor
schema.processors.model_fit_processor.ModelFitProcessor(
trained_model: model_processor.ModelType
)
The proto contains performance metrics for each dataset as well as a list of predictions.
Methods
execute
execute(
specs: Sequence[schema.processors.model_fit_processor.ModelFitSpec]
) -> model_fit_pb2.ModelFit
Runs an analysis/optimization on the model using the given specs.
| Args | |
|---|---|
specs
|
Sequence of Specs containing parameters needed for the
analysis/optimization. The specs must all be of the same type as
self.spec_type() for this processor
|
| Returns | |
|---|---|
| A proto containing the results of the analysis/optimization. |
output_type
@classmethodoutput_type() -> type[model_fit_pb2.ModelFit]
Returns the concrete output type that this ModelProcessor produces.
spec_type
@classmethodspec_type() -> type[ModelFitSpec]
Returns the concrete Spec type that this ModelProcessor operates on.
__call__
__call__(
specs: Sequence[S], output: pb.Mmm
)
Runs an analysis/optimization on the model using the given specs.
This also sets the appropriate output field in the given MmmOutput proto.
| Args | |
|---|---|
specs
|
Sequence of Specs containing parameters needed for the
analysis/optimization. The specs must all be of the same type as
self.spec_type() for this processor
|
output
|
The output proto to which the results of the analysis/optimization should be attached. |
| Raises | |
|---|---|
ValueError
|
If any spec is not of the same type as self.spec_type().
|
View source on GitHub