openstef 3.4.42__tar.gz → 3.4.43__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.
- {openstef-3.4.42 → openstef-3.4.43}/PKG-INFO +1 -1
- {openstef-3.4.42 → openstef-3.4.43}/openstef/data_classes/prediction_job.py +3 -1
- openstef-3.4.43/openstef/enums.py +132 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/feature_engineering/apply_features.py +15 -1
- openstef-3.4.43/openstef/feature_engineering/bidding_zone_to_country_mapping.py +106 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/feature_engineering/holiday_features.py +32 -23
- {openstef-3.4.42 → openstef-3.4.43}/openstef.egg-info/PKG-INFO +1 -1
- {openstef-3.4.42 → openstef-3.4.43}/openstef.egg-info/SOURCES.txt +1 -0
- {openstef-3.4.42 → openstef-3.4.43}/setup.py +1 -1
- openstef-3.4.42/openstef/enums.py +0 -28
- {openstef-3.4.42 → openstef-3.4.43}/LICENSE +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/README.md +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/__main__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/app_settings.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_baseline_model.z +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_baseline_model.z.license +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_model_card.md +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_model_card.md.license +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/data/dutch_holidays.csv +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/data/dutch_holidays.csv.license +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/data/pv_single_coefs.csv +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/data/pv_single_coefs.csv.license +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/data_classes/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/data_classes/data_prep.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/data_classes/model_specifications.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/data_classes/split_function.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/exceptions.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/feature_engineering/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/feature_engineering/data_preparation.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/feature_engineering/feature_adder.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/feature_engineering/feature_applicator.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/feature_engineering/general.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/feature_engineering/lag_features.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/feature_engineering/missing_values_transformer.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/feature_engineering/weather_features.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/metrics/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/metrics/figure.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/metrics/metrics.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/metrics/reporter.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/basecase.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/confidence_interval_applicator.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/fallback.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/metamodels/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/metamodels/grouped_regressor.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/metamodels/missing_values_handler.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/model_creator.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/objective.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/objective_creator.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/regressors/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/regressors/arima.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/regressors/custom_regressor.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/regressors/dazls.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/regressors/flatliner.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/regressors/lgbm.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/regressors/linear.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/regressors/linear_quantile.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/regressors/regressor.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/regressors/xgb.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/regressors/xgb_multioutput_quantile.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/regressors/xgb_quantile.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/serializer.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model/standard_deviation_generator.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model_selection/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/model_selection/model_selection.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/monitoring/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/monitoring/performance_meter.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/monitoring/teams.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/pipeline/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/pipeline/create_basecase_forecast.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/pipeline/create_component_forecast.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/pipeline/create_forecast.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/pipeline/optimize_hyperparameters.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/pipeline/train_create_forecast_backtest.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/pipeline/train_model.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/pipeline/utils.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/postprocessing/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/postprocessing/postprocessing.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/preprocessing/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/preprocessing/preprocessing.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/settings.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/calculate_kpi.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/create_basecase_forecast.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/create_components_forecast.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/create_forecast.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/create_solar_forecast.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/create_wind_forecast.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/optimize_hyperparameters.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/split_forecast.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/train_model.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/utils/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/utils/dependencies.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/utils/predictionjobloop.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/tasks/utils/taskcontext.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/validation/__init__.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef/validation/validation.py +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef.egg-info/dependency_links.txt +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef.egg-info/requires.txt +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/openstef.egg-info/top_level.txt +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/pyproject.toml +0 -0
- {openstef-3.4.42 → openstef-3.4.43}/setup.cfg +0 -0
@@ -9,7 +9,7 @@ from pydantic.v1 import BaseModel
|
|
9
9
|
from openstef.data_classes.data_prep import DataPrepDataClass
|
10
10
|
from openstef.data_classes.model_specifications import ModelSpecificationDataClass
|
11
11
|
from openstef.data_classes.split_function import SplitFuncDataClass
|
12
|
-
from openstef.enums import PipelineType
|
12
|
+
from openstef.enums import PipelineType, BiddingZone
|
13
13
|
|
14
14
|
|
15
15
|
class PredictionJobDataClass(BaseModel):
|
@@ -54,6 +54,8 @@ class PredictionJobDataClass(BaseModel):
|
|
54
54
|
lon: Optional[float] = 5.291266
|
55
55
|
"""Longitude of the forecasted location in degrees. Used for fetching weather data in tasks, calculating derrived features and component splitting."""
|
56
56
|
name: str
|
57
|
+
"""Bidding zone is used to determine the electricity price. It is also used to determine the holidays that should be used. Currently only ENTSO-E bidding zones are supported."""
|
58
|
+
electricity_bidding_zone: Optional[BiddingZone] = BiddingZone.NL
|
57
59
|
"""Name of the forecast, e.g. the location name."""
|
58
60
|
train_components: Optional[bool]
|
59
61
|
"""Whether splitting the forecasts in wind, solar, rest is desired."""
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
|
2
|
+
#
|
3
|
+
# SPDX-License-Identifier: MPL-2.0
|
4
|
+
from enum import Enum
|
5
|
+
|
6
|
+
|
7
|
+
class BiddingZone(Enum):
|
8
|
+
DE_50HZ = "DE_50HZ"
|
9
|
+
AL = "AL"
|
10
|
+
DE_AMPRION = "DE_AMPRION"
|
11
|
+
AT = "AT"
|
12
|
+
BY = "BY"
|
13
|
+
BE = "BE"
|
14
|
+
BA = "BA"
|
15
|
+
BG = "BG"
|
16
|
+
CZ_DE_SK = "CZ_DE_SK"
|
17
|
+
HR = "HR"
|
18
|
+
CWE = "CWE"
|
19
|
+
CY = "CY"
|
20
|
+
CZ = "CZ"
|
21
|
+
DE_AT_LU = "DE_AT_LU"
|
22
|
+
DE_LU = "DE_LU"
|
23
|
+
DK = "DK"
|
24
|
+
DK_1 = "DK_1"
|
25
|
+
DK_1_NO_1 = "DK_1_NO_1"
|
26
|
+
DK_2 = "DK_2"
|
27
|
+
DK_CA = "DK_CA"
|
28
|
+
EE = "EE"
|
29
|
+
FI = "FI"
|
30
|
+
MK = "MK"
|
31
|
+
FR = "FR"
|
32
|
+
DE = "DE"
|
33
|
+
GR = "GR"
|
34
|
+
HU = "HU"
|
35
|
+
IS = "IS"
|
36
|
+
IE_SEM = "IE_SEM"
|
37
|
+
IE = "IE"
|
38
|
+
IT = "IT"
|
39
|
+
IT_SACO_AC = "IT_SACO_AC"
|
40
|
+
IT_CALA = "IT_CALA"
|
41
|
+
IT_SACO_DC = "IT_SACO_DC"
|
42
|
+
IT_BRNN = "IT_BRNN"
|
43
|
+
IT_CNOR = "IT_CNOR"
|
44
|
+
IT_CSUD = "IT_CSUD"
|
45
|
+
IT_FOGN = "IT_FOGN"
|
46
|
+
IT_GR = "IT_GR"
|
47
|
+
IT_MACRO_NORTH = "IT_MACRO_NORTH"
|
48
|
+
IT_MACRO_SOUTH = "IT_MACRO_SOUTH"
|
49
|
+
IT_MALTA = "IT_MALTA"
|
50
|
+
IT_NORD = "IT_NORD"
|
51
|
+
IT_NORD_AT = "IT_NORD_AT"
|
52
|
+
IT_NORD_CH = "IT_NORD_CH"
|
53
|
+
IT_NORD_FR = "IT_NORD_FR"
|
54
|
+
IT_NORD_SI = "IT_NORD_SI"
|
55
|
+
IT_PRGP = "IT_PRGP"
|
56
|
+
IT_ROSN = "IT_ROSN"
|
57
|
+
IT_SARD = "IT_SARD"
|
58
|
+
IT_SICI = "IT_SICI"
|
59
|
+
IT_SUD = "IT_SUD"
|
60
|
+
RU_KGD = "RU_KGD"
|
61
|
+
LV = "LV"
|
62
|
+
LT = "LT"
|
63
|
+
LU = "LU"
|
64
|
+
LU_BZN = "LU_BZN"
|
65
|
+
MT = "MT"
|
66
|
+
ME = "ME"
|
67
|
+
GB = "GB"
|
68
|
+
GE = "GE"
|
69
|
+
GB_IFA = "GB_IFA"
|
70
|
+
GB_IFA2 = "GB_IFA2"
|
71
|
+
GB_ELECLINK = "GB_ELECLINK"
|
72
|
+
UK = "UK"
|
73
|
+
NL = "NL"
|
74
|
+
NO_1 = "NO_1"
|
75
|
+
NO_1A = "NO_1A"
|
76
|
+
NO_2 = "NO_2"
|
77
|
+
NO_2_NSL = "NO_2_NSL"
|
78
|
+
NO_2A = "NO_2A"
|
79
|
+
NO_3 = "NO_3"
|
80
|
+
NO_4 = "NO_4"
|
81
|
+
NO_5 = "NO_5"
|
82
|
+
NO = "NO"
|
83
|
+
PL_CZ = "PL_CZ"
|
84
|
+
PL = "PL"
|
85
|
+
PT = "PT"
|
86
|
+
MD = "MD"
|
87
|
+
RO = "RO"
|
88
|
+
RU = "RU"
|
89
|
+
SE_1 = "SE_1"
|
90
|
+
SE_2 = "SE_2"
|
91
|
+
SE_3 = "SE_3"
|
92
|
+
SE_4 = "SE_4"
|
93
|
+
RS = "RS"
|
94
|
+
SK = "SK"
|
95
|
+
SI = "SI"
|
96
|
+
GB_NIR = "GB_NIR"
|
97
|
+
ES = "ES"
|
98
|
+
SE = "SE"
|
99
|
+
CH = "CH"
|
100
|
+
DE_TENNET = "DE_TENNET"
|
101
|
+
DE_TRANSNET = "DE_TRANSNET"
|
102
|
+
TR = "TR"
|
103
|
+
UA = "UA"
|
104
|
+
UA_DOBTPP = "UA_DOBTPP"
|
105
|
+
UA_BEI = "UA_BEI"
|
106
|
+
UA_IPS = "UA_IPS"
|
107
|
+
XK = "XK"
|
108
|
+
DE_AMP_LU = "DE_AMP_LU"
|
109
|
+
|
110
|
+
|
111
|
+
class ModelType(Enum):
|
112
|
+
XGB = "xgb"
|
113
|
+
XGB_QUANTILE = "xgb_quantile"
|
114
|
+
XGB_MULTIOUTPUT_QUANTILE = "xgb_multioutput_quantile"
|
115
|
+
LGB = "lgb"
|
116
|
+
LINEAR = "linear"
|
117
|
+
LINEAR_QUANTILE = "linear_quantile"
|
118
|
+
ARIMA = "arima"
|
119
|
+
FLATLINER = "flatliner"
|
120
|
+
|
121
|
+
|
122
|
+
class ForecastType(Enum):
|
123
|
+
DEMAND = "demand"
|
124
|
+
WIND = "wind"
|
125
|
+
SOLAR = "solar"
|
126
|
+
BASECASE = "basecase"
|
127
|
+
|
128
|
+
|
129
|
+
class PipelineType(Enum):
|
130
|
+
FORECAST = "forecast"
|
131
|
+
TRAIN = "train"
|
132
|
+
HYPER_PARMATERS = "hyper_parameters"
|
@@ -14,10 +14,14 @@ Examples of features that are added:
|
|
14
14
|
import pandas as pd
|
15
15
|
|
16
16
|
from openstef.data_classes.prediction_job import PredictionJobDataClass
|
17
|
+
from openstef.enums import BiddingZone
|
17
18
|
from openstef.feature_engineering.holiday_features import (
|
18
19
|
generate_holiday_feature_functions,
|
19
20
|
)
|
20
21
|
from openstef.feature_engineering.lag_features import generate_lag_feature_functions
|
22
|
+
from openstef.feature_engineering.bidding_zone_to_country_mapping import (
|
23
|
+
BIDDING_ZONE_TO_COUNTRY_CODE_MAPPING,
|
24
|
+
)
|
21
25
|
from openstef.feature_engineering.weather_features import (
|
22
26
|
add_additional_solar_features,
|
23
27
|
add_additional_wind_features,
|
@@ -58,6 +62,7 @@ def apply_features(
|
|
58
62
|
|
59
63
|
import pandas as pd
|
60
64
|
import numpy as np
|
65
|
+
from geopy.geocoders import Nominatim
|
61
66
|
index = pd.date_range(start = "2017-01-01 09:00:00",
|
62
67
|
freq = '15T', periods = 200)
|
63
68
|
data = pd.DataFrame(index = index,
|
@@ -66,6 +71,9 @@ def apply_features(
|
|
66
71
|
np.random.uniform(0.7,1.7, 200)))
|
67
72
|
|
68
73
|
"""
|
74
|
+
if pj is None:
|
75
|
+
pj = {"electricity_bidding_zone": BiddingZone.NL}
|
76
|
+
|
69
77
|
# Get lag feature functions
|
70
78
|
feature_functions = generate_lag_feature_functions(feature_names, horizon)
|
71
79
|
|
@@ -80,8 +88,14 @@ def apply_features(
|
|
80
88
|
}
|
81
89
|
)
|
82
90
|
|
91
|
+
# Get country code from bidding zone if available
|
92
|
+
electricity_bidding_zone = pj.get("electricity_bidding_zone", BiddingZone.NL)
|
93
|
+
country_code = BIDDING_ZONE_TO_COUNTRY_CODE_MAPPING[electricity_bidding_zone.name]
|
94
|
+
|
83
95
|
# Get holiday feature functions
|
84
|
-
feature_functions.update(
|
96
|
+
feature_functions.update(
|
97
|
+
generate_holiday_feature_functions(country_code=country_code)
|
98
|
+
)
|
85
99
|
|
86
100
|
# Add the features to the dataframe using previously defined feature functions
|
87
101
|
for key, featfunc in feature_functions.items():
|
@@ -0,0 +1,106 @@
|
|
1
|
+
# SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
|
2
|
+
#
|
3
|
+
# SPDX-License-Identifier: MPL-2.0
|
4
|
+
BIDDING_ZONE_TO_COUNTRY_CODE_MAPPING = {
|
5
|
+
"DE_50HZ": "DE",
|
6
|
+
"AL": "AL",
|
7
|
+
"DE_AMPRION": "DE",
|
8
|
+
"AT": "AT",
|
9
|
+
"BY": "BY",
|
10
|
+
"BE": "BE",
|
11
|
+
"BA": "BA",
|
12
|
+
"BG": "BG",
|
13
|
+
"CZ_DE_SK": "CZ",
|
14
|
+
"HR": "HR",
|
15
|
+
"CWE": "CWE",
|
16
|
+
"CY": "CY",
|
17
|
+
"CZ": "CZ",
|
18
|
+
"DE_AT_LU": "DE",
|
19
|
+
"DE_LU": "DE",
|
20
|
+
"DK": "DK",
|
21
|
+
"DK_1": "DK",
|
22
|
+
"DK_1_NO_1": "DK",
|
23
|
+
"DK_2": "DK",
|
24
|
+
"DK_CA": "DK",
|
25
|
+
"EE": "EE",
|
26
|
+
"FI": "FI",
|
27
|
+
"MK": "MK",
|
28
|
+
"FR": "FR",
|
29
|
+
"DE": "DE",
|
30
|
+
"GR": "GR",
|
31
|
+
"HU": "HU",
|
32
|
+
"IS": "IS",
|
33
|
+
"IE_SEM": "IE",
|
34
|
+
"IE": "IE",
|
35
|
+
"IT": "IT",
|
36
|
+
"IT_SACO_AC": "IT",
|
37
|
+
"IT_CALA": "IT",
|
38
|
+
"IT_SACO_DC": "IT",
|
39
|
+
"IT_BRNN": "IT",
|
40
|
+
"IT_CNOR": "IT",
|
41
|
+
"IT_CSUD": "IT",
|
42
|
+
"IT_FOGN": "IT",
|
43
|
+
"IT_GR": "IT",
|
44
|
+
"IT_MACRO_NORTH": "IT",
|
45
|
+
"IT_MACRO_SOUTH": "IT",
|
46
|
+
"IT_MALTA": "IT",
|
47
|
+
"IT_NORD": "IT",
|
48
|
+
"IT_NORD_AT": "IT",
|
49
|
+
"IT_NORD_CH": "IT",
|
50
|
+
"IT_NORD_FR": "IT",
|
51
|
+
"IT_NORD_SI": "IT",
|
52
|
+
"IT_PRGP": "IT",
|
53
|
+
"IT_ROSN": "IT",
|
54
|
+
"IT_SARD": "IT",
|
55
|
+
"IT_SICI": "IT",
|
56
|
+
"IT_SUD": "IT",
|
57
|
+
"RU_KGD": "RU",
|
58
|
+
"LV": "LV",
|
59
|
+
"LT": "LT",
|
60
|
+
"LU": "LU",
|
61
|
+
"LU_BZN": "LU",
|
62
|
+
"MT": "MT",
|
63
|
+
"ME": "ME",
|
64
|
+
"GB": "GB",
|
65
|
+
"GE": "GE",
|
66
|
+
"GB_IFA": "GB",
|
67
|
+
"GB_IFA2": "GB",
|
68
|
+
"GB_ELECLINK": "GB",
|
69
|
+
"UK": "UK",
|
70
|
+
"NL": "NL",
|
71
|
+
"NO_1": "NO",
|
72
|
+
"NO_1A": "NO",
|
73
|
+
"NO_2": "NO",
|
74
|
+
"NO_2_NSL": "NO",
|
75
|
+
"NO_2A": "NO",
|
76
|
+
"NO_3": "NO",
|
77
|
+
"NO_4": "NO",
|
78
|
+
"NO_5": "NO",
|
79
|
+
"NO": "NO",
|
80
|
+
"PL_CZ": "PL",
|
81
|
+
"PL": "PL",
|
82
|
+
"PT": "PT",
|
83
|
+
"MD": "MD",
|
84
|
+
"RO": "RO",
|
85
|
+
"RU": "RU",
|
86
|
+
"SE_1": "SE",
|
87
|
+
"SE_2": "SE",
|
88
|
+
"SE_3": "SE",
|
89
|
+
"SE_4": "SE",
|
90
|
+
"RS": "RS",
|
91
|
+
"SK": "SK",
|
92
|
+
"SI": "SI",
|
93
|
+
"GB_NIR": "GB",
|
94
|
+
"ES": "ES",
|
95
|
+
"SE": "SE",
|
96
|
+
"CH": "CH",
|
97
|
+
"DE_TENNET": "DE",
|
98
|
+
"DE_TRANSNET": "DE",
|
99
|
+
"TR": "TR",
|
100
|
+
"UA": "UA",
|
101
|
+
"UA_DOBTPP": "UA",
|
102
|
+
"UA_BEI": "UA",
|
103
|
+
"UA_IPS": "UA",
|
104
|
+
"XK": "XK",
|
105
|
+
"DE_AMP_LU": "DE",
|
106
|
+
}
|
@@ -14,7 +14,7 @@ HOLIDAY_CSV_PATH: str = PROJECT_ROOT / "openstef" / "data" / "dutch_holidays.csv
|
|
14
14
|
|
15
15
|
|
16
16
|
def generate_holiday_feature_functions(
|
17
|
-
|
17
|
+
country_code: str = "NL",
|
18
18
|
years: list = None,
|
19
19
|
path_to_school_holidays_csv: str = HOLIDAY_CSV_PATH,
|
20
20
|
) -> dict:
|
@@ -69,7 +69,7 @@ def generate_holiday_feature_functions(
|
|
69
69
|
now.year + 1,
|
70
70
|
]
|
71
71
|
|
72
|
-
country_holidays = holidays.country_holidays(
|
72
|
+
country_holidays = holidays.country_holidays(country_code, years=years)
|
73
73
|
|
74
74
|
# Make holiday function dict
|
75
75
|
holiday_functions = {}
|
@@ -96,7 +96,7 @@ def generate_holiday_feature_functions(
|
|
96
96
|
|
97
97
|
# Check for bridge day
|
98
98
|
holiday_functions, bridge_days = check_for_bridge_day(
|
99
|
-
date, holiday_name,
|
99
|
+
date, holiday_name, country_code, years, holiday_functions, bridge_days
|
100
100
|
)
|
101
101
|
|
102
102
|
# Add feature function that includes all bridgedays
|
@@ -104,33 +104,42 @@ def generate_holiday_feature_functions(
|
|
104
104
|
{"is_bridgeday": lambda x: np.isin(x.index.date, np.array(list(bridge_days)))}
|
105
105
|
)
|
106
106
|
|
107
|
-
#
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
)
|
115
|
-
|
116
|
-
# Loop over list of holidays names
|
117
|
-
for holiday_name in list(set(df_holidays.name)):
|
118
|
-
# Define function explicitely to mitigate 'late binding' problem
|
119
|
-
def make_holiday_func(holidayname=holiday_name):
|
120
|
-
return lambda x: np.isin(
|
121
|
-
x.index.date, df_holidays.datum[df_holidays.name == holidayname].values
|
122
|
-
)
|
107
|
+
# Add school holidays if country is NL
|
108
|
+
if country_code == "NL":
|
109
|
+
# Manully generated csv including all dutch schoolholidays for different regions
|
110
|
+
df_holidays = pd.read_csv(path_to_school_holidays_csv, index_col=None)
|
111
|
+
df_holidays["datum"] = pd.to_datetime(df_holidays.datum).apply(
|
112
|
+
lambda x: x.date()
|
113
|
+
)
|
123
114
|
|
124
|
-
#
|
115
|
+
# Add check function that includes all holidays of the provided csv
|
125
116
|
holiday_functions.update(
|
126
117
|
{
|
127
|
-
"
|
128
|
-
|
129
|
-
holidayname=holiday_name
|
118
|
+
"is_schoolholiday": lambda x: np.isin(
|
119
|
+
x.index.date, df_holidays.datum.values
|
130
120
|
)
|
131
121
|
}
|
132
122
|
)
|
133
123
|
|
124
|
+
# Loop over list of holidays names
|
125
|
+
for holiday_name in list(set(df_holidays.name)):
|
126
|
+
# Define function explicitely to mitigate 'late binding' problem
|
127
|
+
def make_holiday_func(holidayname=holiday_name):
|
128
|
+
return lambda x: np.isin(
|
129
|
+
x.index.date,
|
130
|
+
df_holidays.datum[df_holidays.name == holidayname].values,
|
131
|
+
)
|
132
|
+
|
133
|
+
# Create lag function for each holiday
|
134
|
+
holiday_functions.update(
|
135
|
+
{
|
136
|
+
"is_"
|
137
|
+
+ holiday_name.replace(" ", "_").lower(): make_holiday_func(
|
138
|
+
holidayname=holiday_name
|
139
|
+
)
|
140
|
+
}
|
141
|
+
)
|
142
|
+
|
134
143
|
return holiday_functions
|
135
144
|
|
136
145
|
|
@@ -29,6 +29,7 @@ openstef/data_classes/prediction_job.py
|
|
29
29
|
openstef/data_classes/split_function.py
|
30
30
|
openstef/feature_engineering/__init__.py
|
31
31
|
openstef/feature_engineering/apply_features.py
|
32
|
+
openstef/feature_engineering/bidding_zone_to_country_mapping.py
|
32
33
|
openstef/feature_engineering/data_preparation.py
|
33
34
|
openstef/feature_engineering/feature_adder.py
|
34
35
|
openstef/feature_engineering/feature_applicator.py
|
@@ -29,7 +29,7 @@ def read_long_description_from_readme():
|
|
29
29
|
|
30
30
|
setup(
|
31
31
|
name="openstef",
|
32
|
-
version="3.4.
|
32
|
+
version="3.4.43",
|
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(),
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
|
2
|
-
#
|
3
|
-
# SPDX-License-Identifier: MPL-2.0
|
4
|
-
from enum import Enum
|
5
|
-
|
6
|
-
|
7
|
-
class ModelType(Enum):
|
8
|
-
XGB = "xgb"
|
9
|
-
XGB_QUANTILE = "xgb_quantile"
|
10
|
-
XGB_MULTIOUTPUT_QUANTILE = "xgb_multioutput_quantile"
|
11
|
-
LGB = "lgb"
|
12
|
-
LINEAR = "linear"
|
13
|
-
LINEAR_QUANTILE = "linear_quantile"
|
14
|
-
ARIMA = "arima"
|
15
|
-
FLATLINER = "flatliner"
|
16
|
-
|
17
|
-
|
18
|
-
class ForecastType(Enum):
|
19
|
-
DEMAND = "demand"
|
20
|
-
WIND = "wind"
|
21
|
-
SOLAR = "solar"
|
22
|
-
BASECASE = "basecase"
|
23
|
-
|
24
|
-
|
25
|
-
class PipelineType(Enum):
|
26
|
-
FORECAST = "forecast"
|
27
|
-
TRAIN = "train"
|
28
|
-
HYPER_PARMATERS = "hyper_parameters"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{openstef-3.4.42 → openstef-3.4.43}/openstef/feature_engineering/missing_values_transformer.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|