openstef 3.4.44__tar.gz → 3.4.45__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. {openstef-3.4.44 → openstef-3.4.45}/PKG-INFO +1 -1
  2. {openstef-3.4.44 → openstef-3.4.45}/openstef/data_classes/prediction_job.py +3 -0
  3. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/train_model.py +32 -1
  4. {openstef-3.4.44 → openstef-3.4.45}/openstef.egg-info/PKG-INFO +1 -1
  5. {openstef-3.4.44 → openstef-3.4.45}/setup.py +1 -1
  6. {openstef-3.4.44 → openstef-3.4.45}/LICENSE +0 -0
  7. {openstef-3.4.44 → openstef-3.4.45}/README.md +0 -0
  8. {openstef-3.4.44 → openstef-3.4.45}/openstef/__init__.py +0 -0
  9. {openstef-3.4.44 → openstef-3.4.45}/openstef/__main__.py +0 -0
  10. {openstef-3.4.44 → openstef-3.4.45}/openstef/app_settings.py +0 -0
  11. {openstef-3.4.44 → openstef-3.4.45}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_baseline_model.z +0 -0
  12. {openstef-3.4.44 → openstef-3.4.45}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_baseline_model.z.license +0 -0
  13. {openstef-3.4.44 → openstef-3.4.45}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_model_card.md +0 -0
  14. {openstef-3.4.44 → openstef-3.4.45}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_model_card.md.license +0 -0
  15. {openstef-3.4.44 → openstef-3.4.45}/openstef/data/dutch_holidays.csv +0 -0
  16. {openstef-3.4.44 → openstef-3.4.45}/openstef/data/dutch_holidays.csv.license +0 -0
  17. {openstef-3.4.44 → openstef-3.4.45}/openstef/data/pv_single_coefs.csv +0 -0
  18. {openstef-3.4.44 → openstef-3.4.45}/openstef/data/pv_single_coefs.csv.license +0 -0
  19. {openstef-3.4.44 → openstef-3.4.45}/openstef/data_classes/__init__.py +0 -0
  20. {openstef-3.4.44 → openstef-3.4.45}/openstef/data_classes/data_prep.py +0 -0
  21. {openstef-3.4.44 → openstef-3.4.45}/openstef/data_classes/model_specifications.py +0 -0
  22. {openstef-3.4.44 → openstef-3.4.45}/openstef/data_classes/split_function.py +0 -0
  23. {openstef-3.4.44 → openstef-3.4.45}/openstef/enums.py +0 -0
  24. {openstef-3.4.44 → openstef-3.4.45}/openstef/exceptions.py +0 -0
  25. {openstef-3.4.44 → openstef-3.4.45}/openstef/feature_engineering/__init__.py +0 -0
  26. {openstef-3.4.44 → openstef-3.4.45}/openstef/feature_engineering/apply_features.py +0 -0
  27. {openstef-3.4.44 → openstef-3.4.45}/openstef/feature_engineering/bidding_zone_to_country_mapping.py +0 -0
  28. {openstef-3.4.44 → openstef-3.4.45}/openstef/feature_engineering/cyclic_features.py +0 -0
  29. {openstef-3.4.44 → openstef-3.4.45}/openstef/feature_engineering/data_preparation.py +0 -0
  30. {openstef-3.4.44 → openstef-3.4.45}/openstef/feature_engineering/feature_adder.py +0 -0
  31. {openstef-3.4.44 → openstef-3.4.45}/openstef/feature_engineering/feature_applicator.py +0 -0
  32. {openstef-3.4.44 → openstef-3.4.45}/openstef/feature_engineering/general.py +0 -0
  33. {openstef-3.4.44 → openstef-3.4.45}/openstef/feature_engineering/holiday_features.py +0 -0
  34. {openstef-3.4.44 → openstef-3.4.45}/openstef/feature_engineering/lag_features.py +0 -0
  35. {openstef-3.4.44 → openstef-3.4.45}/openstef/feature_engineering/missing_values_transformer.py +0 -0
  36. {openstef-3.4.44 → openstef-3.4.45}/openstef/feature_engineering/weather_features.py +0 -0
  37. {openstef-3.4.44 → openstef-3.4.45}/openstef/metrics/__init__.py +0 -0
  38. {openstef-3.4.44 → openstef-3.4.45}/openstef/metrics/figure.py +0 -0
  39. {openstef-3.4.44 → openstef-3.4.45}/openstef/metrics/metrics.py +0 -0
  40. {openstef-3.4.44 → openstef-3.4.45}/openstef/metrics/reporter.py +0 -0
  41. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/__init__.py +0 -0
  42. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/basecase.py +0 -0
  43. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/confidence_interval_applicator.py +0 -0
  44. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/fallback.py +0 -0
  45. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/metamodels/__init__.py +0 -0
  46. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/metamodels/grouped_regressor.py +0 -0
  47. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/metamodels/missing_values_handler.py +0 -0
  48. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/model_creator.py +0 -0
  49. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/objective.py +0 -0
  50. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/objective_creator.py +0 -0
  51. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/regressors/__init__.py +0 -0
  52. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/regressors/arima.py +0 -0
  53. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/regressors/custom_regressor.py +0 -0
  54. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/regressors/dazls.py +0 -0
  55. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/regressors/flatliner.py +0 -0
  56. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/regressors/lgbm.py +0 -0
  57. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/regressors/linear.py +0 -0
  58. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/regressors/linear_quantile.py +0 -0
  59. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/regressors/regressor.py +0 -0
  60. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/regressors/xgb.py +0 -0
  61. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/regressors/xgb_multioutput_quantile.py +0 -0
  62. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/regressors/xgb_quantile.py +0 -0
  63. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/serializer.py +0 -0
  64. {openstef-3.4.44 → openstef-3.4.45}/openstef/model/standard_deviation_generator.py +0 -0
  65. {openstef-3.4.44 → openstef-3.4.45}/openstef/model_selection/__init__.py +0 -0
  66. {openstef-3.4.44 → openstef-3.4.45}/openstef/model_selection/model_selection.py +0 -0
  67. {openstef-3.4.44 → openstef-3.4.45}/openstef/monitoring/__init__.py +0 -0
  68. {openstef-3.4.44 → openstef-3.4.45}/openstef/monitoring/performance_meter.py +0 -0
  69. {openstef-3.4.44 → openstef-3.4.45}/openstef/monitoring/teams.py +0 -0
  70. {openstef-3.4.44 → openstef-3.4.45}/openstef/pipeline/__init__.py +0 -0
  71. {openstef-3.4.44 → openstef-3.4.45}/openstef/pipeline/create_basecase_forecast.py +0 -0
  72. {openstef-3.4.44 → openstef-3.4.45}/openstef/pipeline/create_component_forecast.py +0 -0
  73. {openstef-3.4.44 → openstef-3.4.45}/openstef/pipeline/create_forecast.py +0 -0
  74. {openstef-3.4.44 → openstef-3.4.45}/openstef/pipeline/optimize_hyperparameters.py +0 -0
  75. {openstef-3.4.44 → openstef-3.4.45}/openstef/pipeline/train_create_forecast_backtest.py +0 -0
  76. {openstef-3.4.44 → openstef-3.4.45}/openstef/pipeline/train_model.py +0 -0
  77. {openstef-3.4.44 → openstef-3.4.45}/openstef/pipeline/utils.py +0 -0
  78. {openstef-3.4.44 → openstef-3.4.45}/openstef/postprocessing/__init__.py +0 -0
  79. {openstef-3.4.44 → openstef-3.4.45}/openstef/postprocessing/postprocessing.py +0 -0
  80. {openstef-3.4.44 → openstef-3.4.45}/openstef/preprocessing/__init__.py +0 -0
  81. {openstef-3.4.44 → openstef-3.4.45}/openstef/preprocessing/preprocessing.py +0 -0
  82. {openstef-3.4.44 → openstef-3.4.45}/openstef/settings.py +0 -0
  83. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/__init__.py +0 -0
  84. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/calculate_kpi.py +0 -0
  85. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/create_basecase_forecast.py +0 -0
  86. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/create_components_forecast.py +0 -0
  87. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/create_forecast.py +0 -0
  88. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/create_solar_forecast.py +0 -0
  89. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/create_wind_forecast.py +0 -0
  90. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/optimize_hyperparameters.py +0 -0
  91. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/split_forecast.py +0 -0
  92. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/utils/__init__.py +0 -0
  93. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/utils/dependencies.py +0 -0
  94. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/utils/predictionjobloop.py +0 -0
  95. {openstef-3.4.44 → openstef-3.4.45}/openstef/tasks/utils/taskcontext.py +0 -0
  96. {openstef-3.4.44 → openstef-3.4.45}/openstef/validation/__init__.py +0 -0
  97. {openstef-3.4.44 → openstef-3.4.45}/openstef/validation/validation.py +0 -0
  98. {openstef-3.4.44 → openstef-3.4.45}/openstef.egg-info/SOURCES.txt +0 -0
  99. {openstef-3.4.44 → openstef-3.4.45}/openstef.egg-info/dependency_links.txt +0 -0
  100. {openstef-3.4.44 → openstef-3.4.45}/openstef.egg-info/requires.txt +0 -0
  101. {openstef-3.4.44 → openstef-3.4.45}/openstef.egg-info/top_level.txt +0 -0
  102. {openstef-3.4.44 → openstef-3.4.45}/pyproject.toml +0 -0
  103. {openstef-3.4.44 → openstef-3.4.45}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openstef
3
- Version: 3.4.44
3
+ Version: 3.4.45
4
4
  Summary: Open short term energy forecaster
5
5
  Home-page: https://github.com/OpenSTEF/openstef
6
6
  Author: Alliander N.V
@@ -79,6 +79,9 @@ class PredictionJobDataClass(BaseModel):
79
79
  """Minimum length (in rows) of the forecast input for making a regular forecast."""
80
80
  flatliner_threshold_minutes: int = 1440
81
81
  """Number of minutes that the load has to be constant to detect a flatliner. """
82
+ data_balancing_ratio: Optional[float] = None
83
+ """If data balancing is enabled, the data will be balanced with data from 1 year
84
+ ago in the future."""
82
85
  depends_on: Optional[list[Union[int, str]]]
83
86
  """Link to another prediction job on which this prediction job might depend."""
84
87
  sid: Optional[str]
@@ -22,6 +22,8 @@ Example:
22
22
  from datetime import datetime, timedelta
23
23
  from pathlib import Path
24
24
 
25
+ import pandas as pd
26
+
25
27
  from openstef.data_classes.prediction_job import PredictionJobDataClass
26
28
  from openstef.enums import ModelType, PipelineType
27
29
  from openstef.exceptions import (
@@ -114,10 +116,16 @@ def train_model_task(
114
116
  return
115
117
 
116
118
  # Define start and end of the training input data
119
+ training_period_days_to_fetch = (
120
+ TRAINING_PERIOD_DAYS
121
+ if pj.data_balancing_ratio is None
122
+ else int(pj.data_balancing_ratio * TRAINING_PERIOD_DAYS)
123
+ )
124
+
117
125
  if datetime_end is None:
118
126
  datetime_end = datetime.utcnow()
119
127
  if datetime_start is None:
120
- datetime_start = datetime_end - timedelta(days=TRAINING_PERIOD_DAYS)
128
+ datetime_start = datetime_end - timedelta(days=training_period_days_to_fetch)
121
129
 
122
130
  # Get training input data from database
123
131
  input_data = context.database.get_model_input(
@@ -127,6 +135,29 @@ def train_model_task(
127
135
  datetime_end=datetime_end,
128
136
  )
129
137
 
138
+ # If data balancing is enabled, fetch data from 1 year ago and combine it with the
139
+ # current data
140
+ if pj.data_balancing_ratio is not None:
141
+ # Because the data is from the past, we can use the data from the "future"
142
+ balanced_datetime_start = datetime_end - timedelta(days=365)
143
+ balanced_datetime_end = balanced_datetime_start + timedelta(
144
+ days=training_period_days_to_fetch
145
+ )
146
+
147
+ balanced_input_data = context.database.get_model_input(
148
+ pid=pj["id"],
149
+ location=[pj["lat"], pj["lon"]],
150
+ datetime_start=balanced_datetime_start,
151
+ datetime_end=balanced_datetime_end,
152
+ )
153
+
154
+ input_data = pd.concat(
155
+ [
156
+ balanced_input_data,
157
+ input_data,
158
+ ]
159
+ )
160
+
130
161
  context.perf_meter.checkpoint("Retrieved timeseries input")
131
162
 
132
163
  # Excecute the model training pipeline
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openstef
3
- Version: 3.4.44
3
+ Version: 3.4.45
4
4
  Summary: Open short term energy forecaster
5
5
  Home-page: https://github.com/OpenSTEF/openstef
6
6
  Author: Alliander N.V
@@ -29,7 +29,7 @@ def read_long_description_from_readme():
29
29
 
30
30
  setup(
31
31
  name="openstef",
32
- version="3.4.44",
32
+ version="3.4.45",
33
33
  packages=find_packages(include=["openstef", "openstef.*"]),
34
34
  description="Open short term energy forecaster",
35
35
  long_description=read_long_description_from_readme(),
File without changes
File without changes
File without changes
File without changes
File without changes