Docs /Templates/ sinapsis-darts-forecasting

MinTReconciliatorWrapper

sinapsis-darts-forecastingDartsdatadartsdynamicforecasting

Python template · sinapsis_darts_forecasting.templates.time_series_preprocessing

Overview

A dynamic preprocessing template for applying Darts transformations to time series data.

This template allows users to apply various transformations from `darts.dataprocessing.transformers` to different parts of the time series packet (`content`, `past_covariates`, `future_covariates`).

If a transformer requires fitting (e.g., `Scaler`), it stores and retrieves transformation parameters.

MinTReconciliator — inherited documentation

Helper class that provides a standard way to create an ABC using inheritance. MinT Reconcilator.

This implements the MinT reconciliation approach presented in [1]_ and summarised in [2]_.

Parameters ---------- method This parameter can take four different values, determining how the covariance matrix ``W`` of the forecast errors is estimated (corresponding to ``Wh`` in [2]_):

* ``ols`` uses ``W = I``. This option looks only at the hierarchy but ignores the values of the series provided to ``fit()``. * ``wls_struct`` uses ``W = diag(S1)``, where ``S1`` is a vector of size `n` with values between 0 and `m`, representing the number of base components composing each of the `n` components. This options looks only at the hierarchy but ignores the values of the series provided to ``fit()``. * ``wls_var`` uses ``W = diag(W1)``, where ``W1`` is the temporal average of the variance of the forecasting residuals. This method assumes that the series provided to ``fit()`` contain the forecast residuals (deterministic series). * ``mint_cov`` computes ``W`` as the empirical covariance matrix of the residuals for each component, with residuals samples taken over time. This method assumes that the series provided to ``fit()`` contain the forecast residuals (deterministic series), and it requires the residuals to be linearly independent. * ``wls_val`` uses ``W = diag(V1)``, where ``V1`` is the temporal average of the component values. This method assumes that the series provided to ``fit()`` contains an example of the actual values (e.g., either the training series or the forecasts). This method is not presented in [2]_.

References ---------- .. [1] `Optimal forecast reconciliation for hierarchical and grouped time series through trace minimization <https://robjhyndman.com/papers/MinT.pdf>`__ .. [2] https://otexts.com/fpp3/reconciliation.html#the-mint-optimal-reconciliation-approach

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-darts-forecasting==1.0.0
uv pip install sinapsis-darts-forecasting==1.0.0
uv add sinapsis-darts-forecasting==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

methodRequired
typing.Literal['fit', 'transform', 'fit_transform', 'inverse_transform']
Required
Default: null
apply_toRequired
list[typing.Literal['content', 'past_covariates', 'future_covariates', 'predictions']]
Required
Default: null
metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
params_key
str | None
Optional
Default: null
transform_kwargs
dict[str, typing.Any]
Optional
Default: null
mintreconciliator_initRequired
__init__Attributes
Required
Default: null
method
str
Optional
Default: "ols"

Configuration example

Generated from documented defaults. Replace any placeholders and complete required nested settings before running.

yaml
templates:
  - template_name: "MinTReconciliatorWrapper"
    class_name: "MinTReconciliatorWrapper"
    attributes:
      method: "<required>"
      apply_to: "<required>"
      params_key: null
      transform_kwargs: null
      mintreconciliator_init:
        method: "ols"
View original docstring example

The source example references MissingValuesFillerWrapper, not MinTReconciliatorWrapper.

yaml
agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: MissingValuesFillerWrapper
  class_name: MissingValuesFillerWrapper
  template_input: InputTemplate
  attributes:
    method: "transform"
    apply_to: ["content"]
    transform_kwargs:
        method: "linear"
    missingvaluesfiller_init:
        fill: "auto"
        name: "MissingValuesFiller"
        n_jobs: 1
        verbose: False
For a full list of options use the sinapsis cli: sinapsis info --all-template-names
If you want to see all available transformers, please visit: https://unit8co.github.io/darts/generated_api/darts.dataprocessing.transformers.html

Inheritance

Immediate parent: sinapsis_darts_forecasting.templates.time_series_preprocessing.TimeSeriesPreprocessor

Environment variables

Environment definitions belong to their canonical Python modules.

SINAPSIS_BUILD_DOCS · defined elsewhere