sktime.forecasting.trend

class sktime.forecasting.trend.PolynomialTrendForecaster(regressor=None, degree=1, with_intercept=True)[source]

Bases: sktime.forecasting.base._sktime._OptionalForecastingHorizonMixin, sktime.forecasting.base._sktime._SktimeForecaster

Forecast time series data with a polynomial trend. Default settings train a linear regression model with a 1st degree polynomial transformation of the feature.

Parameters
  • regressor (estimator object, optional (default = None)) –

    Define the regression model type. If not set, will default to

    sklearn.linear_model.LinearRegression

  • degree (int, optional (default = 1)) – Degree of polynomial function

  • with_intercept (bool, optional (default=True)) – If true, then include a feature in which all polynomial powers are zero. (i.e. a column of ones, acts as an intercept term in a linear model)

fit(y, X=None, fh=None)[source]

Fit to training data.

Parameters
  • y (pd.Series) – Target time series with which to fit the forecaster.

  • fh (int, list or np.array, optional (default=None)) – The forecast horizon with the steps ahead to predict.

  • X (pd.DataFrame, optional (default=None)) – Exogenous variables are ignored

Returns

self

Return type

returns an instance of self.