Skip to content

NaiveForecaster

yohou_nixtla.stats.NaiveForecaster

Bases: BaseStatsForecaster

Naive forecaster via statsforecast.

Repeats the last observed value for all forecast steps.

Parameters

Name Type Description Default
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.Naive.

{}

Attributes

Name Type Description
nixtla_forecaster_ StatsForecast

The fitted Nixtla orchestrator.

instance_ Naive

The constructed Naive model instance.

See Also

SeasonalNaiveForecaster : Seasonal naive baseline.

Examples

>>> from yohou_nixtla.stats import NaiveForecaster
>>> forecaster = NaiveForecaster()
>>> forecaster
NaiveForecaster(...)

Source Code

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

    Repeats the last observed value for all forecast steps.

    Parameters
    ----------
    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.Naive``.

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

    See Also
    --------
    SeasonalNaiveForecaster : Seasonal naive baseline.

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

    """

    _estimator_default_class = Naive

Tutorials

The following example notebooks use this component:

  • How to Forecast Panel Data


    Forecast multiple related time series using the panel column naming convention.

    View · Open in marimo