commonpower.data_forecasting.forecasters.ConstantForecaster

class ConstantForecaster(frequency: timedelta = datetime.timedelta(seconds=3600), horizon: timedelta = datetime.timedelta(days=1))[source]

Bases: Forecaster

This forecaster predicts all future timesteps with the “current” value.

Parameters:
  • frequency (timedelta, optional) – Frequency of generated forecasts. Defaults to timedelta(hours=1).

  • horizon (timedelta, optional) – Horizon to generate forecasts for. Defaults to timedelta(hours=24).

Methods

Attributes

input_range

Returns the min and max timedelta of observations which are required for the prediction.

is_uncertain

__call__(data: ndarray) ndarray[source]

Returns the forecast based on this data.

Parameters:

data (np.ndarray) – Data to use for the forecast.

Returns:

np.ndarray – Forecast of shape (n_horizon, n_vars)