NaiveMovingAverageWrapper
Python template · sinapsis_darts_forecasting.templates.time_series_model
Overview
Base Template for Darts Time Series forecasting models.
NaiveMovingAverage — inherited documentation
The base class for "local" forecasting models, handling only single univariate time series.
Local Forecasting Models (LFM) are models that can be trained on a single univariate target series only. In Darts, most models in this category tend to be simpler statistical models (such as ETS or FFT). LFMs usually train on the entire target series supplied when calling :func:`fit()` at once. They can also predict in one go with :func:`predict()` for any number of predictions `n` after the end of the training series.
All implementations must implement the `fit()` and `predict()` methods.Naive Moving Average Model
This model forecasts using an autoregressive moving average (ARMA).
Parameters ---------- input_chunk_length The size of the sliding window used to calculate the moving average
Examples -------- >>> from darts.datasets import AirPassengersDataset >>> from darts.models import NaiveMovingAverage >>> series = AirPassengersDataset().load() # using the average of the last 6 months >>> model = NaiveMovingAverage(input_chunk_length=6) >>> pred = model.predict(6) >>> print(pred.values()) [[503.16666667] [483.36111111] [462.9212963 ] [455.40817901] [454.47620885] [465.22224366]]
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-darts-forecasting==1.0.0uv pip install sinapsis-darts-forecasting==1.0.0uv add sinapsis-darts-forecasting==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
Optional
Default: null
Optional
Default: false
Optional
Default: 10
Required
Default: null
Optional
Default: 1
Configuration example
Generated from documented defaults. Replace any placeholders and complete required nested settings before running.
templates:
- template_name: "NaiveMovingAverageWrapper"
class_name: "NaiveMovingAverageWrapper"
attributes:
validation_mode: false
forecast_horizon: 10
naivemovingaverage_init:
input_chunk_length: 1
View original docstring example
The source example references XGBModelWrapper, not NaiveMovingAverageWrapper.
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: XGBModelWrapper
class_name: XGBModelWrapper
template_input: InputTemplate
attributes:
forecast_horizon: 100
xgbmodel_init:
lags: 30
lags_past_covariates: 30
output_chunk_length: 100
random_state: 42
n_estimators: 200
learning_rate: 0.1
max_depth: 6
For a full list of options use the sinapsis cli: sinapsis info --all-template-names.
If you want to see all available models, please visit:
https://unit8co.github.io/darts/generated_api/darts.models.forecasting.htmlInheritance
sinapsis_darts_forecasting.templates.time_series_model.TimeSeriesModelEnvironment variables
Environment definitions belong to their canonical Python modules.