TrendForecasterSKTimeWrapper
Python template · sinapsis_sktime.templates.sktime_forecasters
Overview
This template specifically handles sktime series forecasting tasks.
The goal is to train a model and predict future values of the input time series.
Attributes: WrapperEntry (WrapperEntryConfig): Configuration for dynamic template generation TASK_TYPE (str): The type of task (forecasting) CATEGORY (str): The category of the template AttributesBaseModel: Reference to the attributes' model class
TrendForecaster — inherited documentation
Trend based forecasts of time series data, regressing values on index.
Uses an ``sklearn`` regressor specified by the ``regressor`` parameter to perform regression on time series values against their corresponding indices, providing trend-based forecasts:
In ``fit``, for input time series :math:`(v_i, t_i), i = 1, \dots, T`, where :math:`v_i` are values and :math:`t_i` are time stamps, fits an ``sklearn`` model :math:`v_i = f(t_i) + \epsilon_i`, where :math:`f` is the model fitted when ``regressor.fit`` is passed ``X`` = vector of :math:`t_i`, and ``y`` = vector of :math:`v_i`.
In ``predict``, for a new time point :math:`t_*`, predicts :math:`f(t_*)`, where :math:`f` is the function as fitted above in ``fit``.
Default for ``regressor`` is linear regression = ``sklearn`` ``LinearRegression``, with default parameters.
If time stamps are ``pd.DatetimeIndex``, fitted coefficients are in units of days since start of 1970. If time stamps are ``pd.PeriodIndex``, coefficients are in units of (full) periods since start of 1970.
Parameters ---------- regressor : estimator object, default = None Define the regression model type. If not set, will default to sklearn.linear_model.LinearRegression
Attributes ---------- regressor_ : sklearn regressor estimator object The fitted regressor object. Clone of ``regressor``.
Examples -------- >>> from sktime.datasets import load_airline >>> from sktime.forecasting.trend import TrendForecaster >>> y = load_airline() >>> forecaster = TrendForecaster() >>> forecaster.fit(y) TrendForecaster(...) >>> y_pred = forecaster.predict(fh=[1,2,3])
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-sktime==1.0.0uv pip install sinapsis-sktime==1.0.0uv add sinapsis-sktime==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
Optional
Default: null
Optional
Default: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
Number of steps ahead to forecast. Defaults to 37. trendforecaster_init regressor <class 'NoneType'>: default: None
Optional
Default: 37
Required
Default: null
Required
Default: null
Optional
Default: null
Configuration example
Generated from documented defaults. Replace any placeholders and complete required nested settings before running.
templates:
- template_name: "TrendForecasterSKTimeWrapper"
class_name: "TrendForecasterSKTimeWrapper"
attributes:
root_dir: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
n_steps_ahead: 37
model_save_path: "<required>"
trendforecaster_init:
regressor: null
Inheritance
sinapsis_sktime.templates.sktime_forecasters.SKTimeTrendForecasterEnvironment variables
Environment definitions belong to their canonical Python modules.