commonpower.data_forecasting.base.Forecaster
- class Forecaster(frequency: timedelta = datetime.timedelta(seconds=3600), horizon: timedelta = datetime.timedelta(days=1), look_back: timedelta = datetime.timedelta(0))[source]
Bases:
objectForecaster.
- 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).
look_back (timedelta, optional) – Amount of time to look into the past for forecast generation. Defaults to timedelta().
Methods
Attributes
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)
- property input_range: tuple[timedelta]
Returns the min and max timedelta of observations which are required for the prediction. To indicate a timestamp before the current time, the timedelta must be negative. The default is (-self.look_back, 0).
- Returns:
tuple[timedelta] – (td before, td after)