openstef package¶
Subpackages¶
- openstef.data_classes package
- Submodules
- openstef.data_classes.data_prep module
- openstef.data_classes.model_specifications module
- openstef.data_classes.prediction_job module
PredictionJobDataClass
PredictionJobDataClass.Config
PredictionJobDataClass.alternative_forecast_model_pid
PredictionJobDataClass.backtest_split_func
PredictionJobDataClass.completeness_threshold
PredictionJobDataClass.data_prep_class
PredictionJobDataClass.default_modelspecs
PredictionJobDataClass.depends_on
PredictionJobDataClass.description
PredictionJobDataClass.flatliner_threshold_minutes
PredictionJobDataClass.forecast_type
PredictionJobDataClass.get()
PredictionJobDataClass.horizon_minutes
PredictionJobDataClass.hub_height
PredictionJobDataClass.id
PredictionJobDataClass.lat
PredictionJobDataClass.lon
PredictionJobDataClass.minimal_table_length
PredictionJobDataClass.model
PredictionJobDataClass.model_kwargs
PredictionJobDataClass.n_turbines
PredictionJobDataClass.name
PredictionJobDataClass.pipelines_to_run
PredictionJobDataClass.quantiles
PredictionJobDataClass.resolution_minutes
PredictionJobDataClass.save_train_forecasts
PredictionJobDataClass.sid
PredictionJobDataClass.train_components
PredictionJobDataClass.train_horizons_minutes
PredictionJobDataClass.train_split_func
PredictionJobDataClass.turbine_type
- openstef.data_classes.split_function module
- Module contents
- openstef.feature_engineering package
- Submodules
- openstef.feature_engineering.apply_features module
- openstef.feature_engineering.data_preparation module
- openstef.feature_engineering.feature_adder module
- openstef.feature_engineering.feature_applicator module
- openstef.feature_engineering.general module
- openstef.feature_engineering.holiday_features module
- openstef.feature_engineering.lag_features module
- openstef.feature_engineering.missing_values_transformer module
- openstef.feature_engineering.weather_features module
- Module contents
- openstef.metrics package
- openstef.model package
- Subpackages
- openstef.model.metamodels package
- openstef.model.regressors package
- Submodules
- openstef.model.regressors.arima module
- openstef.model.regressors.custom_regressor module
- openstef.model.regressors.dazls module
- openstef.model.regressors.flatliner module
- openstef.model.regressors.lgbm module
- openstef.model.regressors.linear module
- openstef.model.regressors.linear_quantile module
- openstef.model.regressors.regressor module
- openstef.model.regressors.xgb module
- openstef.model.regressors.xgb_multioutput_quantile module
- openstef.model.regressors.xgb_quantile module
- Module contents
- Submodules
- openstef.model.basecase module
- openstef.model.confidence_interval_applicator module
- openstef.model.fallback module
- openstef.model.model_creator module
- openstef.model.objective module
- openstef.model.objective_creator module
- openstef.model.serializer module
- openstef.model.standard_deviation_generator module
- Module contents
- Subpackages
- openstef.model_selection package
- openstef.monitoring package
- openstef.pipeline package
- Submodules
- openstef.pipeline.create_basecase_forecast module
- openstef.pipeline.create_component_forecast module
- openstef.pipeline.create_forecast module
- openstef.pipeline.optimize_hyperparameters module
- openstef.pipeline.train_create_forecast_backtest module
- openstef.pipeline.train_model module
- openstef.pipeline.utils module
- Module contents
- openstef.postprocessing package
- openstef.preprocessing package
- openstef.tasks package
- Subpackages
- Submodules
- openstef.tasks.calculate_kpi module
- openstef.tasks.create_basecase_forecast module
- openstef.tasks.create_components_forecast module
- openstef.tasks.create_forecast module
- openstef.tasks.create_solar_forecast module
- openstef.tasks.create_wind_forecast module
- openstef.tasks.optimize_hyperparameters module
- openstef.tasks.split_forecast module
- openstef.tasks.train_model module
- Module contents
- openstef.validation package
Submodules¶
openstef.app_settings module¶
- class openstef.app_settings.AppSettings(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_implicit_flags=None, _secrets_dir=None, **values)¶
Bases:
BaseSettings
Global app settings.
- log_level: str¶
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_hide_none_type': False, 'cli_implicit_flags': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_settings_source': None, 'cli_use_class_docs_for_groups': False, 'env_file': '.env', 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': 'openstef_', 'extra': 'ignore', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_', 'settings_'), 'secrets_dir': None, 'toml_file': None, 'validate_default': True, 'yaml_file': None, 'yaml_file_encoding': None}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'log_level': FieldInfo(annotation=str, required=False, default='INFO', description='Log level used for logging statements.'), 'post_teams_messages': FieldInfo(annotation=bool, required=False, default=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- post_teams_messages: bool¶
openstef.enums module¶
- class openstef.enums.ForecastType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- BASECASE = 'basecase'¶
- DEMAND = 'demand'¶
- SOLAR = 'solar'¶
- WIND = 'wind'¶
- class openstef.enums.ModelType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- ARIMA = 'arima'¶
- FLATLINER = 'flatliner'¶
- LGB = 'lgb'¶
- LINEAR = 'linear'¶
- LINEAR_QUANTILE = 'linear_quantile'¶
- XGB = 'xgb'¶
- XGB_MULTIOUTPUT_QUANTILE = 'xgb_multioutput_quantile'¶
- XGB_QUANTILE = 'xgb_quantile'¶
openstef.exceptions module¶
Openstef custom exceptions.
- exception openstef.exceptions.ComponentForecastTooShortHorizonError¶
Bases:
Exception
Component forecasts should be available for at least 30 hours in advance.
- exception openstef.exceptions.InputDataInsufficientError¶
Bases:
InputDataInvalidError
Insufficient input data.
- exception openstef.exceptions.InputDataInvalidError¶
Bases:
Exception
Invalid input data.
- exception openstef.exceptions.InputDataOngoingZeroFlatlinerError¶
Bases:
InputDataInvalidError
All recent load measurements are zero.
- exception openstef.exceptions.InputDataWrongColumnOrderError¶
Bases:
InputDataInvalidError
Wrong column order input data.
- exception openstef.exceptions.ModelWithoutStDev¶
Bases:
Exception
A machine learning model should have a valid standard deviation.
- exception openstef.exceptions.NoPredictedLoadError(pid, message='No predicted load found')¶
Bases:
Exception
No predicted load for given datatime range.
- exception openstef.exceptions.NoRealisedLoadError(pid, message='No realised load found')¶
Bases:
Exception
No realised load for given datetime range.
- exception openstef.exceptions.OldModelHigherScoreError¶
Bases:
Exception
Old model has a higher score then new model.
- exception openstef.exceptions.PredictionJobException(metrics=None)¶
Bases:
Exception
One or more prediction jobs raised an exception.
- exception openstef.exceptions.SkipSaveTrainingForecasts¶
Bases:
Exception
If old model is better or too young, you don’t need to save the traing forcast.