commonpower.data_forecasting.forecasters.PerfectKnowledgeForecaster
- class PerfectKnowledgeForecaster(frequency: timedelta = datetime.timedelta(seconds=3600), horizon: timedelta = datetime.timedelta(days=1))[source]
Bases:
ForecasterThis forecaster perfectly predicts future values. This means all time steps in the prediction horizon must be present in the data source.
- 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
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)