Skip to content

SeasonalNaiveForecaster

yohou_nixtla.stats.SeasonalNaiveForecaster

Bases: BaseStatsForecaster

Seasonal Naive forecaster via statsforecast.

Repeats the values from the last seasonal cycle.

Parameters

Name Type Description Default
season_length int

Length of the seasonal period.

7
freq str or None

Frequency string. Auto-inferred from data if None.

None
feature_transformer BaseTransformer or None

Transformer applied to exogenous features before fitting/predicting.

None
target_transformer BaseTransformer or None

Transformer applied to the target before fitting. Inverse-transformed after predicting to return forecasts in the original scale.

None
target_as_feature ('transformed', 'raw')

Whether to include target values as additional features.

"transformed"
**params dict

Additional parameters forwarded to statsforecast.models.SeasonalNaive.

{}

Attributes

Name Type Description
nixtla_forecaster_ StatsForecast

The fitted Nixtla orchestrator.

instance_ SeasonalNaive

The constructed SeasonalNaive model instance.

See Also

NaiveForecaster : Non-seasonal naive baseline.

Examples

>>> from yohou_nixtla.stats import SeasonalNaiveForecaster
>>> forecaster = SeasonalNaiveForecaster(season_length=7)
>>> forecaster
SeasonalNaiveForecaster(...)

Source Code

Show/Hide source
class SeasonalNaiveForecaster(BaseStatsForecaster):
    """Seasonal Naive forecaster via statsforecast.

    Repeats the values from the last seasonal cycle.

    Parameters
    ----------
    season_length : int, default=7
        Length of the seasonal period.
    freq : str or None, default=None
        Frequency string. Auto-inferred from data if None.
    feature_transformer : BaseTransformer or None, default=None
        Transformer applied to exogenous features before fitting/predicting.
    target_transformer : BaseTransformer or None, default=None
        Transformer applied to the target before fitting. Inverse-transformed
        after predicting to return forecasts in the original scale.
    target_as_feature : {"transformed", "raw"} or None, default=None
        Whether to include target values as additional features.
    **params : dict
        Additional parameters forwarded to ``statsforecast.models.SeasonalNaive``.

    Attributes
    ----------
    nixtla_forecaster_ : StatsForecast
        The fitted Nixtla orchestrator.
    instance_ : SeasonalNaive
        The constructed SeasonalNaive model instance.

    See Also
    --------
    NaiveForecaster : Non-seasonal naive baseline.

    Examples
    --------
    >>> from yohou_nixtla.stats import SeasonalNaiveForecaster
    >>> forecaster = SeasonalNaiveForecaster(season_length=7)
    >>> forecaster  # doctest: +ELLIPSIS
    SeasonalNaiveForecaster(...)

    """

    _estimator_default_class = SeasonalNaive

Tutorials

The following example notebooks use this component:

  • How to Compare Forecasters


    Fit multiple statistical forecasters on the same dataset and evaluate their accuracy with MAE.

    View · Open in marimo