openstef 3.4.79__tar.gz → 3.4.83__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.79 → openstef-3.4.83}/PKG-INFO +1 -1
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/metamodels/feature_clipper.py +22 -5
- {openstef-3.4.79 → openstef-3.4.83}/openstef.egg-info/PKG-INFO +1 -1
- {openstef-3.4.79 → openstef-3.4.83}/setup.py +1 -1
- {openstef-3.4.79 → openstef-3.4.83}/LICENSE +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/README.md +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/__main__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/app_settings.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data/NL_terrestrial_radiation.csv +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data/NL_terrestrial_radiation.csv.license +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_baseline_model.z +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_baseline_model.z.license +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_model_card.md +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data/dazls_model_3.4.24/dazls_stored_3.4.24_model_card.md.license +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data/dutch_holidays.csv +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data/dutch_holidays.csv.license +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data/pv_single_coefs.csv +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data/pv_single_coefs.csv.license +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data_classes/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data_classes/data_prep.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data_classes/model_specifications.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data_classes/prediction_job.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/data_classes/split_function.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/enums.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/exceptions.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/apply_features.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/bidding_zone_to_country_mapping.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/cyclic_features.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/data_preparation.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/feature_adder.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/feature_applicator.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/general.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/holiday_features.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/lag_features.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/missing_values_transformer.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/rolling_features.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/weather_features.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/logging/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/logging/base_logger.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/logging/logger_factory.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/logging/logger_types.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/logging/standard_logger.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/logging/structlog_logger.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/metrics/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/metrics/figure.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/metrics/metrics.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/metrics/reporter.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/basecase.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/confidence_interval_applicator.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/fallback.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/metamodels/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/metamodels/grouped_regressor.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/metamodels/missing_values_handler.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/model_creator.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/objective.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/objective_creator.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/arima.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/custom_regressor.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/dazls.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/flatliner.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/gblinear_quantile.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/lgbm.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/linear.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/linear_quantile.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/median.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/regressor.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/xgb.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/xgb_multioutput_quantile.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/regressors/xgb_quantile.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/serializer.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model/standard_deviation_generator.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model_selection/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/model_selection/model_selection.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/monitoring/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/monitoring/performance_meter.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/monitoring/teams.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/pipeline/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/pipeline/create_basecase_forecast.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/pipeline/create_component_forecast.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/pipeline/create_forecast.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/pipeline/optimize_hyperparameters.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/pipeline/train_create_forecast_backtest.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/pipeline/train_model.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/pipeline/utils.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/plotting/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/plotting/load_forecast_plotter.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/postprocessing/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/postprocessing/postprocessing.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/preprocessing/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/preprocessing/preprocessing.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/settings.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/calculate_kpi.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/create_basecase_forecast.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/create_components_forecast.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/create_forecast.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/create_solar_forecast.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/create_wind_forecast.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/optimize_hyperparameters.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/split_forecast.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/train_model.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/utils/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/utils/dependencies.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/utils/predictionjobloop.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/tasks/utils/taskcontext.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/validation/__init__.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef/validation/validation.py +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef.egg-info/SOURCES.txt +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef.egg-info/dependency_links.txt +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef.egg-info/requires.txt +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/openstef.egg-info/top_level.txt +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/pyproject.toml +0 -0
- {openstef-3.4.79 → openstef-3.4.83}/setup.cfg +0 -0
@@ -4,9 +4,15 @@
|
|
4
4
|
from typing import Dict, List, Optional, Tuple
|
5
5
|
|
6
6
|
import pandas as pd
|
7
|
+
from pydantic import BaseModel
|
7
8
|
from sklearn.base import BaseEstimator, TransformerMixin
|
8
9
|
|
9
10
|
|
11
|
+
class FeatureStats(BaseModel):
|
12
|
+
mean: float
|
13
|
+
std: float
|
14
|
+
|
15
|
+
|
10
16
|
class FeatureClipper(BaseEstimator, TransformerMixin):
|
11
17
|
"""
|
12
18
|
A transformer that clips the values of specified columns to the minimum and
|
@@ -14,7 +20,7 @@ class FeatureClipper(BaseEstimator, TransformerMixin):
|
|
14
20
|
extrapolating beyond these values during prediction.
|
15
21
|
"""
|
16
22
|
|
17
|
-
def __init__(self, columns: List[str]):
|
23
|
+
def __init__(self, columns: List[str], clip_number_of_std: float = 2.0):
|
18
24
|
"""
|
19
25
|
Initialize the FeatureClipper.
|
20
26
|
|
@@ -24,7 +30,8 @@ class FeatureClipper(BaseEstimator, TransformerMixin):
|
|
24
30
|
List of column names to be clipped.
|
25
31
|
"""
|
26
32
|
self.columns: List[str] = columns
|
27
|
-
self.feature_ranges: Dict[str, Tuple[float, float]] = {}
|
33
|
+
self.feature_ranges: Dict[str, Tuple[float, float] | FeatureStats] = {}
|
34
|
+
self.clip_number_of_std = clip_number_of_std
|
28
35
|
|
29
36
|
def fit(self, X: pd.DataFrame, y: Optional[pd.Series] = None) -> "FeatureClipper":
|
30
37
|
"""
|
@@ -54,7 +61,9 @@ class FeatureClipper(BaseEstimator, TransformerMixin):
|
|
54
61
|
|
55
62
|
for col in self.columns:
|
56
63
|
if col in X.columns:
|
57
|
-
self.feature_ranges[col] = (
|
64
|
+
self.feature_ranges[col] = FeatureStats(
|
65
|
+
mean=X[col].mean(), std=X[col].std()
|
66
|
+
)
|
58
67
|
|
59
68
|
return self
|
60
69
|
|
@@ -85,7 +94,15 @@ class FeatureClipper(BaseEstimator, TransformerMixin):
|
|
85
94
|
|
86
95
|
for col in self.columns:
|
87
96
|
if col in X_copy.columns and col in self.feature_ranges:
|
88
|
-
|
89
|
-
|
97
|
+
if isinstance(self.feature_ranges[col], FeatureStats):
|
98
|
+
stats = self.feature_ranges[col]
|
99
|
+
X_copy[col] = X_copy[col].clip(
|
100
|
+
lower=stats.mean - self.clip_number_of_std * stats.std,
|
101
|
+
upper=stats.mean + self.clip_number_of_std * stats.std,
|
102
|
+
)
|
103
|
+
else:
|
104
|
+
# Backward compatibility with previous minmax-based implementation
|
105
|
+
min_val, max_val = self.feature_ranges[col]
|
106
|
+
X_copy[col] = X_copy[col].clip(lower=min_val, upper=max_val)
|
90
107
|
|
91
108
|
return X_copy
|
@@ -33,7 +33,7 @@ def read_long_description_from_readme():
|
|
33
33
|
|
34
34
|
setup(
|
35
35
|
name="openstef",
|
36
|
-
version="3.4.
|
36
|
+
version="3.4.83",
|
37
37
|
packages=find_packages(include=["openstef", "openstef.*"]),
|
38
38
|
description="Open short term energy forecaster",
|
39
39
|
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
|
{openstef-3.4.79 → openstef-3.4.83}/openstef/feature_engineering/bidding_zone_to_country_mapping.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
|
{openstef-3.4.79 → openstef-3.4.83}/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
|
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
|