openstef 3.3.11__py3-none-any.whl → 3.3.13__py3-none-any.whl
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/model/serializer.py +16 -5
- {openstef-3.3.11.dist-info → openstef-3.3.13.dist-info}/METADATA +2 -2
- {openstef-3.3.11.dist-info → openstef-3.3.13.dist-info}/RECORD +6 -6
- {openstef-3.3.11.dist-info → openstef-3.3.13.dist-info}/LICENSE +0 -0
- {openstef-3.3.11.dist-info → openstef-3.3.13.dist-info}/WHEEL +0 -0
- {openstef-3.3.11.dist-info → openstef-3.3.13.dist-info}/top_level.txt +0 -0
openstef/model/serializer.py
CHANGED
@@ -27,6 +27,11 @@ class MLflowSerializer:
|
|
27
27
|
self.logger = structlog.get_logger(self.__class__.__name__)
|
28
28
|
mlflow.set_tracking_uri(mlflow_tracking_uri)
|
29
29
|
self.logger.debug(f"MLflow tracking uri at init= {mlflow_tracking_uri}")
|
30
|
+
self.experiment_name_prefix = (
|
31
|
+
os.environ["DATABRICKS_WORKSPACE_PATH"]
|
32
|
+
if "DATABRICKS_WORKSPACE_PATH" in os.environ
|
33
|
+
else ""
|
34
|
+
)
|
30
35
|
|
31
36
|
def save_model(
|
32
37
|
self,
|
@@ -39,7 +44,9 @@ class MLflowSerializer:
|
|
39
44
|
**kwargs,
|
40
45
|
) -> None:
|
41
46
|
"""Save sklearn compatible model to MLFlow."""
|
42
|
-
mlflow.set_experiment(
|
47
|
+
mlflow.set_experiment(
|
48
|
+
experiment_name=self.experiment_name_prefix + experiment_name
|
49
|
+
)
|
43
50
|
with mlflow.start_run(run_name=experiment_name):
|
44
51
|
self._log_model_with_mlflow(
|
45
52
|
model=model,
|
@@ -69,7 +76,7 @@ class MLflowSerializer:
|
|
69
76
|
"""
|
70
77
|
# Get previous run id
|
71
78
|
models_df = self._find_models(
|
72
|
-
experiment_name, max_results=1
|
79
|
+
self.experiment_name_prefix + experiment_name, max_results=1
|
73
80
|
) # returns latest model
|
74
81
|
if not models_df.empty:
|
75
82
|
previous_run_id = models_df["run_id"][
|
@@ -143,7 +150,7 @@ class MLflowSerializer:
|
|
143
150
|
"""
|
144
151
|
try:
|
145
152
|
models_df = self._find_models(
|
146
|
-
experiment_name, max_results=1
|
153
|
+
self.experiment_name_prefix + experiment_name, max_results=1
|
147
154
|
) # return the latest finished run of the model
|
148
155
|
if not models_df.empty:
|
149
156
|
latest_run = models_df.iloc[0] # Use .iloc[0] to only get latest run
|
@@ -177,7 +184,9 @@ class MLflowSerializer:
|
|
177
184
|
if hyperparameter_optimization_only:
|
178
185
|
filter_string += " AND tags.phase = 'Hyperparameter_opt'"
|
179
186
|
models_df = self._find_models(
|
180
|
-
experiment_name,
|
187
|
+
self.experiment_name_prefix + experiment_name,
|
188
|
+
max_results=1,
|
189
|
+
filter_string=filter_string,
|
181
190
|
)
|
182
191
|
if not models_df.empty:
|
183
192
|
run = models_df.iloc[0] # Use .iloc[0] to only get latest run
|
@@ -283,7 +292,9 @@ class MLflowSerializer:
|
|
283
292
|
raise ValueError(
|
284
293
|
f"Max models to keep should be greater than 1! Received: {max_n_models}"
|
285
294
|
)
|
286
|
-
previous_runs = self._find_models(
|
295
|
+
previous_runs = self._find_models(
|
296
|
+
experiment_name=self.experiment_name_prefix + experiment_name
|
297
|
+
)
|
287
298
|
if len(previous_runs) > max_n_models:
|
288
299
|
self.logger.debug(
|
289
300
|
f"Going to delete old models. {len(previous_runs)} > {max_n_models}"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: openstef
|
3
|
-
Version: 3.3.
|
3
|
+
Version: 3.3.13
|
4
4
|
Summary: Open short term energy forecaster
|
5
5
|
Home-page: https://github.com/OpenSTEF/openstef
|
6
6
|
Author: Alliander N.V
|
@@ -30,7 +30,7 @@ Requires-Dist: scikit-learn ~=1.3
|
|
30
30
|
Requires-Dist: scipy ~=1.10
|
31
31
|
Requires-Dist: statsmodels ~=0.13.5
|
32
32
|
Requires-Dist: structlog ~=23.1
|
33
|
-
Requires-Dist: xgboost ~=
|
33
|
+
Requires-Dist: xgboost ~=2.0
|
34
34
|
Provides-Extra: proloaf
|
35
35
|
Requires-Dist: proloaf ==0.2.0 ; extra == 'proloaf'
|
36
36
|
Requires-Dist: torch ==1.10.0 ; extra == 'proloaf'
|
@@ -36,7 +36,7 @@ openstef/model/fallback.py,sha256=VV9ehgnoMZtWzqKk9H1t8wnERFh5CyC4TvDIuRP_ZDI,28
|
|
36
36
|
openstef/model/model_creator.py,sha256=U1Lw4HFyajfxQ2o5lEnCxnmRC62DEu5PBHXrm_jnEJU,5582
|
37
37
|
openstef/model/objective.py,sha256=qBZGij4P2uZXFt-1x4MxCkIRmpVY3TJoo4Mycxu9dO8,15433
|
38
38
|
openstef/model/objective_creator.py,sha256=OiPPFSiSu7z9K_983ib5iqhhu6_9tt7iyTyKNZ2Iz68,2057
|
39
|
-
openstef/model/serializer.py,sha256=
|
39
|
+
openstef/model/serializer.py,sha256=Q7pKkA-K1bszER_tkOWhvwTQsj6-qZoX5zaXIemRKGs,16934
|
40
40
|
openstef/model/standard_deviation_generator.py,sha256=ioQHEIMND_3cjK_-WY-Serx39DaSrA-a2XozuBSNjMM,2912
|
41
41
|
openstef/model/metamodels/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
|
42
42
|
openstef/model/metamodels/grouped_regressor.py,sha256=yMN_a6TnQSyFaqlB_6Nifq-ydpb5hs6w_b97IaBbHj4,8337
|
@@ -85,8 +85,8 @@ openstef/tasks/utils/predictionjobloop.py,sha256=Ysy3zF5lzPMz_asYDKeF5m0qgVT3tCt
|
|
85
85
|
openstef/tasks/utils/taskcontext.py,sha256=yI6TntOkZcW8JiNVuw4uJIigEBL0_iIrkPklF4ZeCX4,5401
|
86
86
|
openstef/validation/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
|
87
87
|
openstef/validation/validation.py,sha256=Mhgizxn-zBGjf5m6WdTLO-WAppFJCPQGD29OsmmelAU,10347
|
88
|
-
openstef-3.3.
|
89
|
-
openstef-3.3.
|
90
|
-
openstef-3.3.
|
91
|
-
openstef-3.3.
|
92
|
-
openstef-3.3.
|
88
|
+
openstef-3.3.13.dist-info/LICENSE,sha256=7Pm2fWFFHHUG5lDHed1vl5CjzxObIXQglnYsEdtjo_k,14907
|
89
|
+
openstef-3.3.13.dist-info/METADATA,sha256=-UyuETPqm_m3Rup7hzqEfiR0kc6X6F_pd9dPzhIl8Vg,7840
|
90
|
+
openstef-3.3.13.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
91
|
+
openstef-3.3.13.dist-info/top_level.txt,sha256=kD0H4PqrQoncZ957FvqwfBxa89kTrun4Z_RAPs_HhLs,9
|
92
|
+
openstef-3.3.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|