sktime.forecasting.online_learning¶
-
class
sktime.forecasting.online_learning.
NNLSEnsemble
(n_estimators=10, loss_func=None)[source]¶ Bases:
sktime.forecasting.online_learning._prediction_weighted_ensembler._PredictionWeightedEnsembler
Ensemble class that performs a non-negative least squares to fit to the estimators. Keeps track of all observations seen so far and fits to it.
- Parameters
n_estimators (int) – number of estimators
loss_func (function) – loss function which follows sklearn.metrics API, for updating weights
-
update
(y_pred, y_true)[source]¶ - Resets the weights over the estimators by passing previous observations
to the weighting algorithm
- Parameters
y_pred (np.array(), shape=(time_axis,estimator_axis)) – array with predictions from the estimators
y_true (np.array(), shape=(time_axis)) – array with actual values for predicted quantity
-
class
sktime.forecasting.online_learning.
NormalHedgeEnsemble
(n_estimators=10, a=1, loss_func=None)[source]¶ Bases:
sktime.forecasting.online_learning._prediction_weighted_ensembler.HedgeExpertEnsemble
Implementation of A Parameter-free Hedging Algorithm, Kamalika Chaudhuri, Yoav Freund, Daniel Hsu (2009) as a hedge-style algorithm.
- Parameters
-
update
(y_pred, y_true, low_c=0.01)[source]¶ - Resets the weights over the estimators by passing previous observations
and updating based on Normal Hedge.
- Parameters
y_pred (np.array(), shape=(time_axis,estimator_axis)) – array with predictions from the estimators
y_true (np.array(), shape=(time_axis)) – array with actual values for predicted quantity
-
class
sktime.forecasting.online_learning.
OnlineEnsembleForecaster
(forecasters, ensemble_algorithm=None, n_jobs=None)[source]¶ Bases:
sktime.forecasting.compose._ensemble.EnsembleForecaster
Online Updating Ensemble of forecasters
- Parameters
-
fit
(y, X=None, fh=None)[source]¶ Fit to training data.
- Parameters
- Returns
self
- Return type
returns an instance of self.
-
update
(y, X=None, update_params=False)[source]¶ Update fitted paramters and performs a new ensemble fit.
- Parameters
y (pd.Series) –
X (pd.DataFrame) –
update_params (bool, optional (default=False)) –
- Returns
self
- Return type
an instance of self