openstef 3.4.30__tar.gz → 3.4.32__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.30 → openstef-3.4.32}/PKG-INFO +2 -2
- {openstef-3.4.30 → openstef-3.4.32}/openstef/feature_engineering/missing_values_transformer.py +18 -14
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/regressors/linear_quantile.py +1 -1
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/regressors/xgb.py +23 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef.egg-info/PKG-INFO +2 -2
- {openstef-3.4.30 → openstef-3.4.32}/openstef.egg-info/requires.txt +1 -1
- {openstef-3.4.30 → openstef-3.4.32}/setup.py +1 -1
- {openstef-3.4.30 → openstef-3.4.32}/LICENSE +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/README.md +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/__main__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/app_settings.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/data/dutch_holidays_2020-2022.csv +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/data/dutch_holidays_2020-2022.csv.license +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/data/pv_single_coefs.csv +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/data/pv_single_coefs.csv.license +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/data_classes/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/data_classes/data_prep.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/data_classes/model_specifications.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/data_classes/prediction_job.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/data_classes/split_function.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/enums.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/exceptions.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/feature_engineering/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/feature_engineering/apply_features.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/feature_engineering/data_preparation.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/feature_engineering/feature_adder.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/feature_engineering/feature_applicator.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/feature_engineering/general.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/feature_engineering/holiday_features.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/feature_engineering/lag_features.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/feature_engineering/weather_features.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/metrics/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/metrics/figure.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/metrics/metrics.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/metrics/reporter.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/basecase.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/confidence_interval_applicator.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/fallback.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/metamodels/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/metamodels/grouped_regressor.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/metamodels/missing_values_handler.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/model_creator.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/objective.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/objective_creator.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/regressors/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/regressors/arima.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/regressors/custom_regressor.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/regressors/dazls.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/regressors/flatliner.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/regressors/lgbm.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/regressors/linear.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/regressors/regressor.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/regressors/xgb_multioutput_quantile.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/regressors/xgb_quantile.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/serializer.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model/standard_deviation_generator.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model_selection/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/model_selection/model_selection.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/monitoring/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/monitoring/performance_meter.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/monitoring/teams.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/pipeline/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/pipeline/create_basecase_forecast.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/pipeline/create_component_forecast.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/pipeline/create_forecast.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/pipeline/optimize_hyperparameters.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/pipeline/train_create_forecast_backtest.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/pipeline/train_model.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/pipeline/utils.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/postprocessing/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/postprocessing/postprocessing.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/preprocessing/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/preprocessing/preprocessing.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/settings.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/calculate_kpi.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/create_basecase_forecast.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/create_components_forecast.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/create_forecast.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/create_solar_forecast.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/create_wind_forecast.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/optimize_hyperparameters.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/split_forecast.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/train_model.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/utils/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/utils/dependencies.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/utils/predictionjobloop.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/tasks/utils/taskcontext.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/validation/__init__.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef/validation/validation.py +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef.egg-info/SOURCES.txt +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef.egg-info/dependency_links.txt +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/openstef.egg-info/top_level.txt +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/pyproject.toml +0 -0
- {openstef-3.4.30 → openstef-3.4.32}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: openstef
|
3
|
-
Version: 3.4.
|
3
|
+
Version: 3.4.32
|
4
4
|
Summary: Open short term energy forecaster
|
5
5
|
Home-page: https://github.com/OpenSTEF/openstef
|
6
6
|
Author: Alliander N.V
|
@@ -31,7 +31,7 @@ Requires-Dist: pydantic-settings~=2.3
|
|
31
31
|
Requires-Dist: pymsteams~=0.2.2
|
32
32
|
Requires-Dist: scikit-learn~=1.3
|
33
33
|
Requires-Dist: scipy~=1.10
|
34
|
-
Requires-Dist: statsmodels
|
34
|
+
Requires-Dist: statsmodels<1.0.0,>=0.13.5
|
35
35
|
Requires-Dist: structlog<25,>=23.1
|
36
36
|
Requires-Dist: xgboost~=2.0
|
37
37
|
|
{openstef-3.4.30 → openstef-3.4.32}/openstef/feature_engineering/missing_values_transformer.py
RENAMED
@@ -7,7 +7,7 @@ import numpy as np
|
|
7
7
|
import pandas as pd
|
8
8
|
from sklearn.impute import SimpleImputer
|
9
9
|
from sklearn.preprocessing import FunctionTransformer
|
10
|
-
from sklearn.utils.validation import check_array
|
10
|
+
from sklearn.utils.validation import check_array, check_is_fitted
|
11
11
|
|
12
12
|
|
13
13
|
class MissingValuesTransformer:
|
@@ -42,6 +42,20 @@ class MissingValuesTransformer:
|
|
42
42
|
self.missing_values = missing_values
|
43
43
|
self.imputation_strategy = imputation_strategy
|
44
44
|
self.fill_value = fill_value
|
45
|
+
self.is_fitted_ = False
|
46
|
+
|
47
|
+
# Build the proper imputation transformer
|
48
|
+
# - Identity function if strategy is None
|
49
|
+
# - SimpleImputer with the dedicated strategy
|
50
|
+
if self.imputation_strategy is None:
|
51
|
+
self.imputer_ = FunctionTransformer(func=self._identity)
|
52
|
+
else:
|
53
|
+
self.imputer_ = SimpleImputer(
|
54
|
+
missing_values=self.missing_values,
|
55
|
+
strategy=self.imputation_strategy,
|
56
|
+
fill_value=self.fill_value,
|
57
|
+
).set_output(transform="pandas")
|
58
|
+
self.imputer_._validate_params()
|
45
59
|
|
46
60
|
def fit(self, x, y=None):
|
47
61
|
"""Fit the imputer on the input data."""
|
@@ -56,23 +70,13 @@ class MissingValuesTransformer:
|
|
56
70
|
is_column_null = x.isnull().all(axis="index")
|
57
71
|
self.non_null_feature_names = list(x.columns[~is_column_null])
|
58
72
|
|
59
|
-
# Build the proper imputation transformer
|
60
|
-
# - Identity function if strategy is None
|
61
|
-
# - SimpleImputer with the dedicated strategy
|
62
|
-
if self.imputation_strategy is None:
|
63
|
-
self.imputer_ = FunctionTransformer(func=self._identity)
|
64
|
-
else:
|
65
|
-
self.imputer_ = SimpleImputer(
|
66
|
-
missing_values=self.missing_values,
|
67
|
-
strategy=self.imputation_strategy,
|
68
|
-
fill_value=self.fill_value,
|
69
|
-
).set_output(transform="pandas")
|
70
|
-
|
71
73
|
# Imputers do not support labels
|
72
|
-
self.imputer_.fit(X=x, y=None)
|
74
|
+
self.imputer_.fit(X=x[self.non_null_feature_names], y=None)
|
75
|
+
self.is_fitted_ = True
|
73
76
|
|
74
77
|
def transform(self, x) -> pd.DataFrame:
|
75
78
|
"""Transform the input data by imputing missing values."""
|
79
|
+
check_is_fitted(self)
|
76
80
|
_ = check_array(x, force_all_finite="allow-nan")
|
77
81
|
if not isinstance(x, pd.DataFrame):
|
78
82
|
x = pd.DataFrame(np.asarray(x))
|
@@ -1,6 +1,10 @@
|
|
1
1
|
# SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com> # noqa E501>
|
2
2
|
#
|
3
3
|
# SPDX-License-Identifier: MPL-2.0
|
4
|
+
from typing import Optional
|
5
|
+
|
6
|
+
import numpy as np
|
7
|
+
from sklearn.base import RegressorMixin
|
4
8
|
|
5
9
|
from xgboost import XGBRegressor
|
6
10
|
|
@@ -27,3 +31,22 @@ class XGBOpenstfRegressor(XGBRegressor, OpenstfRegressor):
|
|
27
31
|
"gain_importance_name": "total_gain",
|
28
32
|
"weight_importance_name": "weight",
|
29
33
|
}
|
34
|
+
|
35
|
+
def fit(
|
36
|
+
self,
|
37
|
+
x: np.array,
|
38
|
+
y: np.array,
|
39
|
+
*,
|
40
|
+
early_stopping_rounds: Optional[int] = None,
|
41
|
+
callbacks: Optional[list] = None,
|
42
|
+
eval_metric: Optional[str] = None,
|
43
|
+
**kwargs
|
44
|
+
):
|
45
|
+
if early_stopping_rounds is not None:
|
46
|
+
self.set_params(early_stopping_rounds=early_stopping_rounds)
|
47
|
+
if callbacks is not None:
|
48
|
+
self.set_params(callbacks=callbacks)
|
49
|
+
if eval_metric is not None:
|
50
|
+
self.set_params(eval_metric=eval_metric)
|
51
|
+
|
52
|
+
super().fit(x, y, **kwargs)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: openstef
|
3
|
-
Version: 3.4.
|
3
|
+
Version: 3.4.32
|
4
4
|
Summary: Open short term energy forecaster
|
5
5
|
Home-page: https://github.com/OpenSTEF/openstef
|
6
6
|
Author: Alliander N.V
|
@@ -31,7 +31,7 @@ Requires-Dist: pydantic-settings~=2.3
|
|
31
31
|
Requires-Dist: pymsteams~=0.2.2
|
32
32
|
Requires-Dist: scikit-learn~=1.3
|
33
33
|
Requires-Dist: scipy~=1.10
|
34
|
-
Requires-Dist: statsmodels
|
34
|
+
Requires-Dist: statsmodels<1.0.0,>=0.13.5
|
35
35
|
Requires-Dist: structlog<25,>=23.1
|
36
36
|
Requires-Dist: xgboost~=2.0
|
37
37
|
|
@@ -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.32",
|
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
|
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
|
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
|