flexmeasures.data.models.forecasting

Modules

flexmeasures.data.models.forecasting.custom_models

flexmeasures.data.models.forecasting.exceptions

flexmeasures.data.models.forecasting.pipelines

flexmeasures.data.models.forecasting.utils

Classes

class flexmeasures.data.models.forecasting.Forecaster(config: dict | None = None, save_config=True, save_parameters=False, **kwargs)
_clean_parameters(parameters: dict) dict

Clean out DataGenerator parameters that should not be stored as DataSource attributes.

These parameters are already contained in the TimedBelief:

  • end-date: as the event end

  • max-forecast-horizon: as the maximum belief horizon of the beliefs for a given event

  • forecast-frequency: as the spacing between unique belief times

  • probabilistic: as the cumulative_probability of each belief

  • sensor-to-save: as the sensor on which the beliefs are recorded

Other:

  • model-save-dir: used internally for the train and predict pipelines to save and load the model

  • output-path: for exporting forecasts to file, more of a developer feature

  • as-job: only indicates whether the computation was offloaded to a worker

_compute(check_output_resolution=True, as_job: bool = False, **kwargs) list[dict[str, Any]]

This method triggers the creation of a new forecast.

The same object can generate multiple forecasts with different start, end, resolution and belief_time values.

Parameters:
  • check_output_resolution – If True, checks each output for whether the event_resolution matches that of the sensor it is supposed to be recorded on.

  • as_job – If True, runs as a job.

_compute_forecast(as_job: bool = False, **kwargs) list[dict[str, Any]]

Overwrite with the actual computation of your forecast.

Parameters:

as_job – If True, runs as a job.

Returns:

List of dictionaries, for example: [

{

“sensor”: 501, “data”: <a BeliefsDataFrame>,

},

]

class flexmeasures.data.models.forecasting.SuppressTorchWarning(name='')

Suppress specific Torch warnings from Darts library about model availability.

filter(record)

Determine if the specified record is to be logged.

Returns True if the record should be logged, or False otherwise. If deemed appropriate, the record may be modified in-place.