ModelFitResult#

class openstef_models.models.forecasting_model.ModelFitResult(**data: Any) None[source]

Bases: BaseModel

Result of fitting a forecasting model.

Contains the original input dataset, split datasets used for training/validation/testing, and evaluation metrics computed on each subset.

Parameters:

data (Any)

input_dataset: TimeSeriesDataset
input_data_train: ForecastInputDataset
input_data_val: ForecastInputDataset | None
input_data_test: ForecastInputDataset | None
metrics_train: SubsetMetric
metrics_val: SubsetMetric | None
metrics_test: SubsetMetric | None
metrics_full: SubsetMetric
metrics_to_flat_dict() dict[str, float][source]

Flatten all split metrics into a single dict for logging.

Keys are prefixed with full_, train_, val_, test_ respectively. Subclasses with child results (e.g. per-forecaster) should override to include them.

Return type:

dict[str, float]

Returns:

Flat mapping of metric names to values.

property component_fit_results: dict[str, ModelFitResult]

Per-component fit results (e.g. per-forecaster in an ensemble).

Returns:

Empty dict by default; ensemble subclasses override.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'protected_namespaces': (), 'ser_json_inf_nan': 'null'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].