SeasonalNaive¶
yohou.point.naive.SeasonalNaive
¶
Bases: BasePointForecaster
Seasonal naive forecaster that repeats values from previous season.
Parameters¶
| Name | Type | Description | Default |
|---|---|---|---|
seasonality
|
int
|
The seasonal period length. For example, 7 for weekly seasonality in daily data, or 12 for monthly seasonality in monthly data. |
1
|
panel_strategy
|
('global', multivariate)
|
How to handle panel data. See |
"global"
|
Attributes¶
| Name | Type | Description |
|---|---|---|
interval_ |
str
|
Detected time interval of the training data. |
Examples¶
>>> import polars as pl
>>> from datetime import datetime
>>> from yohou.point import SeasonalNaive
>>>
>>> df = pl.DataFrame({
... "time": pl.datetime_range(
... start=datetime(2021, 1, 1),
... end=datetime(2021, 1, 10),
... interval="1d",
... eager=True,
... ),
... "value": [1.0, 2.0, 3.0, 1.0, 2.0, 3.0, 1.0, 2.0, 3.0, 1.0],
... })
>>> forecaster = SeasonalNaive(seasonality=3)
>>> _ = forecaster.fit(y=df, forecasting_horizon=3)
>>> y_pred = forecaster.predict(forecasting_horizon=3)
>>> len(y_pred)
3
Notes¶
Predictions repeat the last seasonality observed values
cyclically. For example, with seasonality=7 the forecast for
each day equals the observation from the same weekday in the last
observed week.
See Also¶
MeanSeasonalNaive: Averages multiple past seasonal cycles.PointReductionForecaster: ML-based point forecaster.
Source Code¶
Show/Hide source
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
Methods¶
__sklearn_tags__()
¶
Get estimator tags.
Returns¶
| Type | Description |
|---|---|
Tags
|
Estimator tags with yohou-specific attributes. |
Source Code¶
Show/Hide source
Tutorials¶
The following example notebooks use this component:
-
How to Compose Features with FeatureUnion
Data-Features
Combine lag features, rolling statistics, EMA, and scaling in parallel with FeatureUnion and automatic observation horizon resolution.
-
How to Build a Feature Pipeline
Data-Features
Nest FeaturePipeline, FeatureUnion, and DecompositionPipeline for multi-level feature engineering with trend-season-residual decomposition.
-
How to Create a Custom Scorer
Evaluation-Search
Implement a custom point scorer with aggregation, panel support, and systematic testing.
-
How to Score Multi-Vintage Forecasts
Evaluation-Search
Generate multi-vintage predictions with observe_predict, score per step and per vintage, and visualize with heatmap, per-step, and per-vintage plots.
-
How to Use Point Forecast Metrics
Evaluation-Search
Compare MAE, MAPE, MASE, RMSE, and other point metrics across multiple forecasters with componentwise and groupwise aggregation.
-
How to Combine Interval Forecasters
Forecasting-Models
Build interval ensembles with VotingIntervalForecaster using envelope, mean, and median aggregation strategies.
-
How to Combine Forecasters with VotingPointForecaster
Forecasting-Models
Build point ensembles with VotingPointForecaster using mean, weighted, and median aggregation strategies.
-
How to Choose a Forecasting Method
Getting-Started
Interactive decision guide progressing from SeasonalNaive baseline through linear reduction, stationarity transforms, feature enrichment, nonlinear models, decomposition, and prediction intervals.
-
Conformal Prediction Intervals
Getting-Started
Build distribution-free prediction intervals with SplitConformalForecaster using calibration holdouts and configurable conformity scoring functions.
-
How to Create a Custom Estimator
Getting-Started
Implement a LastValueForecaster from scratch, validate it with the check generator, and use it in a forecast pipeline.
-
Forecasting Workflow
Getting-Started
Evaluate forecasters with cross-validation, search hyperparameters with GridSearchCV, and inspect residuals to diagnose model weaknesses.
-
Naive Forecasters
Getting-Started
Baseline forecasting (the first portion of the First Forecast tutorial) with SeasonalNaive using different seasonality periods, the observe/predict streaming workflow, and rolling evaluation patterns.
-
Panel Data Forecasting
Getting-Started
Forecast multiple related time series simultaneously using the __ naming convention, LocalPanelForecaster, and per-group scoring.
-
How to Save and Load Forecasters
Getting-Started
Serialize fitted forecasters with joblib and pickle, reload them in a fresh session, and produce predictions without retraining.
-
How to Configure LocalPanelForecaster
Panel-Data
Wrap any forecaster with LocalPanelForecaster for fully independent per-group clones, parallel fitting via n_jobs, and selective group operations.
-
How to Forecast Multiple Columns Independently
Panel-Data
Use ColumnForecaster to apply a point forecaster independently to each column of a multivariate time series.
-
How to Build Panel Feature Pipelines
Panel-Data
Combine ColumnForecaster, FeaturePipeline, FeatureUnion, and DecompositionPipeline on panel data with per-group scoring on KDD Cup air quality.
-
Quickstart
Quickstart
Comprehensive end-to-end tour of yohou beyond the Getting Started tutorials, covering data loading, baseline forecasting, preprocessing pipelines, decomposition, cross-validation search, and interval prediction.
-
How to Visualize Forecast Evaluation Results
Visualization
Use plot_calibration, plot_score_per_step, and plot_forecast to diagnose forecast accuracy and interval calibration visually.
-
Forecast Visualization
Visualization
Visualise point forecasts from single and multiple models, decomposition pipeline components, and time weight decay functions with interactive Plotly.
-
How to Visualize Model Selection Results
Visualization
Visualise CV fold geometry with expanding and sliding window splitters and hyperparameter search results with plot_splits and plot_cv_results_scatter.