NormalHedgeEnsemble#

class NormalHedgeEnsemble(n_estimators=10, a=1, loss_func=None)[source]#

Parameter free hedging algorithm.

Implementation of A Parameter-free Hedging Algorithm, Kamalika Chaudhuri, Yoav Freund, Daniel Hsu (2009) as a hedge-style algorithm.

Parameters:
n_estimatorsfloat

number of estimators

Tint

forecasting horizon (in terms of timesteps)

afloat

normalizing constant

loss_funcfunction

loss function which follows sklearn.metrics API, for updating weights

Methods

update(y_pred, y_true[, low_c])

Update forecaster weights.

update(y_pred, y_true, low_c=0.01)[source]#

Update forecaster weights.

The weights are updated over the estimators by passing previous observations and updating based on Normal Hedge.

Parameters:
y_prednp.array(), shape=(time_axis,estimator_axis)

array with predictions from the estimators

y_truenp.array(), shape=(time_axis)

array with actual values for predicted quantity