openstef 3.4.9__py3-none-any.whl → 3.4.29__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.
Files changed (72) hide show
  1. openstef/app_settings.py +19 -0
  2. openstef/data_classes/data_prep.py +1 -1
  3. openstef/data_classes/prediction_job.py +12 -8
  4. openstef/enums.py +3 -7
  5. openstef/exceptions.py +1 -1
  6. openstef/feature_engineering/apply_features.py +0 -6
  7. openstef/feature_engineering/data_preparation.py +12 -5
  8. openstef/feature_engineering/feature_applicator.py +1 -5
  9. openstef/feature_engineering/general.py +14 -0
  10. openstef/feature_engineering/lag_features.py +1 -1
  11. openstef/feature_engineering/missing_values_transformer.py +99 -0
  12. openstef/feature_engineering/weather_features.py +7 -0
  13. openstef/metrics/figure.py +3 -0
  14. openstef/metrics/metrics.py +58 -1
  15. openstef/metrics/reporter.py +7 -0
  16. openstef/model/confidence_interval_applicator.py +28 -3
  17. openstef/model/model_creator.py +36 -27
  18. openstef/model/objective.py +11 -28
  19. openstef/model/objective_creator.py +4 -3
  20. openstef/model/regressors/arima.py +1 -1
  21. openstef/model/regressors/dazls.py +35 -96
  22. openstef/model/regressors/flatliner.py +100 -0
  23. openstef/model/regressors/linear_quantile.py +247 -0
  24. openstef/model/regressors/xgb_multioutput_quantile.py +261 -0
  25. openstef/model/regressors/xgb_quantile.py +3 -0
  26. openstef/model/serializer.py +10 -0
  27. openstef/model/standard_deviation_generator.py +3 -2
  28. openstef/model_selection/model_selection.py +3 -0
  29. openstef/monitoring/performance_meter.py +1 -2
  30. openstef/monitoring/teams.py +11 -0
  31. openstef/pipeline/create_basecase_forecast.py +11 -1
  32. openstef/pipeline/create_component_forecast.py +11 -22
  33. openstef/pipeline/create_forecast.py +20 -1
  34. openstef/pipeline/optimize_hyperparameters.py +18 -16
  35. openstef/pipeline/train_create_forecast_backtest.py +11 -1
  36. openstef/pipeline/train_model.py +23 -7
  37. openstef/pipeline/utils.py +3 -0
  38. openstef/postprocessing/postprocessing.py +29 -0
  39. openstef/settings.py +15 -0
  40. openstef/tasks/calculate_kpi.py +20 -17
  41. openstef/tasks/create_basecase_forecast.py +13 -5
  42. openstef/tasks/create_components_forecast.py +20 -4
  43. openstef/tasks/create_forecast.py +5 -2
  44. openstef/tasks/split_forecast.py +7 -0
  45. openstef/tasks/train_model.py +7 -5
  46. openstef/tasks/utils/taskcontext.py +7 -0
  47. openstef/validation/validation.py +27 -2
  48. {openstef-3.4.9.dist-info → openstef-3.4.29.dist-info}/METADATA +34 -38
  49. openstef-3.4.29.dist-info/RECORD +91 -0
  50. {openstef-3.4.9.dist-info → openstef-3.4.29.dist-info}/WHEEL +1 -1
  51. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_adaptation_model.z +0 -0
  52. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_adaptation_model.z.license +0 -3
  53. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_adaptation_model_features.z +0 -0
  54. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_adaptation_model_features.z.license +0 -3
  55. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_adaptation_model_scaler.z +0 -0
  56. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_adaptation_model_scaler.z.license +0 -3
  57. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_domain_model.z +0 -0
  58. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_domain_model.z.license +0 -3
  59. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_domain_model_features.z +0 -2
  60. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_domain_model_features.z.license +0 -3
  61. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_domain_model_scaler.z +0 -0
  62. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_domain_model_scaler.z.license +0 -3
  63. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_target.z +0 -0
  64. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_target.z.license +0 -3
  65. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_target_scaler.z +0 -6
  66. openstef/data/dazls_model_3.4.0/dazls_stored_3.4.0_target_scaler.z.license +0 -3
  67. openstef/feature_engineering/historic_features.py +0 -40
  68. openstef/model/regressors/proloaf.py +0 -281
  69. openstef/tasks/run_tracy.py +0 -145
  70. openstef-3.4.9.dist-info/RECORD +0 -104
  71. {openstef-3.4.9.dist-info → openstef-3.4.29.dist-info}/LICENSE +0 -0
  72. {openstef-3.4.9.dist-info → openstef-3.4.29.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openstef
3
- Version: 3.4.9
3
+ Version: 3.4.29
4
4
  Summary: Open short term energy forecaster
5
5
  Home-page: https://github.com/OpenSTEF/openstef
6
6
  Author: Alliander N.V
@@ -22,20 +22,18 @@ Requires-Dist: matplotlib ~=3.7
22
22
  Requires-Dist: mlflow ~=2.3
23
23
  Requires-Dist: networkx ~=3.1
24
24
  Requires-Dist: optuna ~=3.1
25
+ Requires-Dist: optuna-integration ~=3.6
25
26
  Requires-Dist: pandas ~=2.2.0
26
27
  Requires-Dist: plotly ~=5.18
27
28
  Requires-Dist: pvlib ==0.9.4
28
29
  Requires-Dist: pydantic ~=2.4
30
+ Requires-Dist: pydantic-settings ~=2.3
29
31
  Requires-Dist: pymsteams ~=0.2.2
30
32
  Requires-Dist: scikit-learn ~=1.3
31
33
  Requires-Dist: scipy ~=1.10
32
34
  Requires-Dist: statsmodels ~=0.13.5
33
- Requires-Dist: structlog ~=23.1
35
+ Requires-Dist: structlog <25,>=23.1
34
36
  Requires-Dist: xgboost ~=2.0
35
- Provides-Extra: proloaf
36
- Requires-Dist: proloaf ==0.2.0 ; extra == 'proloaf'
37
- Requires-Dist: torch ==1.10.0 ; extra == 'proloaf'
38
- Requires-Dist: pytorch-lightning ==1.5.1 ; extra == 'proloaf'
39
37
 
40
38
  <!--
41
39
  SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
@@ -43,9 +41,11 @@ SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.te
43
41
  SPDX-License-Identifier: MPL-2.0
44
42
  -->
45
43
 
46
- <!-- Github Actions badges -->
47
- [![Python Build](https://github.com/openstef/openstef/actions/workflows/python-build.yaml/badge.svg)](https://github.com/openstef/openstef/actions/workflows/python-build.yaml)
48
- [![REUSE Compliance Check](https://github.com/openstef/openstef/actions/workflows/reuse-compliance.yaml/badge.svg)](https://github.com/openstef/openstef/actions/workflows/reuse-compliance.yaml)
44
+ # OpenSTEF
45
+ <!-- Badges -->
46
+ [![Downloads](https://static.pepy.tech/badge/openstef)](https://pepy.tech/project/openstef)
47
+ [![Downloads](https://static.pepy.tech/badge/openstef/month)](https://pepy.tech/project/openstef)
48
+ [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5585/badge)](https://bestpractices.coreinfrastructure.org/projects/5585)
49
49
  <!-- SonarCloud badges -->
50
50
  [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=bugs)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
51
51
  [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=code_smells)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
@@ -56,30 +56,29 @@ SPDX-License-Identifier: MPL-2.0
56
56
  [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=security_rating)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
57
57
  [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=sqale_index)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
58
58
  [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=OpenSTEF_openstef&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=OpenSTEF_openstef)
59
- [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5585/badge)](https://bestpractices.coreinfrastructure.org/projects/5585)
60
59
 
61
- # OpenSTEF
62
60
  OpenSTEF is a Python package designed for generating short-term forecasts in the energy sector. The repository includes all the essential components required for machine learning pipelines that facilitate the forecasting process. To utilize the package, users are required to furnish their own data storage and retrieval interface.
63
61
 
64
62
  # Table of contents
63
+ - [OpenSTEF](#openstef)
64
+ - [Table of contents](#table-of-contents)
65
65
  - [External information sources](#external-information-sources)
66
- - [Installation](install)
67
- - [Usage](usage)
68
- - [Reference Implementation](reference-implementation)
69
- - [Database connector for OpenSTEF](Openstef-dbc-Database-connector-for-openstef)
66
+ - [Installation](#install)
67
+ - [Usage](#usage)
68
+ - [Example notebooks](#example-notebooks)
69
+ - [Reference Implementation](#reference-implementation)
70
+ - [Database connector for OpenSTEF](#database-connector-for-openstef)
70
71
  - [License](license)
71
- - [Licences third-party libraries](licenses-third-party-libraries)
72
- - [Contributing](contributing)
73
- - [Contact](contact)
72
+ - [Contributing](#contributing)
73
+ - [Contact](#contact)
74
74
 
75
75
  # External information sources
76
76
  - [Documentation website](https://openstef.github.io/openstef/index.html);
77
77
  - [Python package](https://pypi.org/project/openstef/);
78
- - [Project website](https://www.lfenergy.org/projects/openstef/);
78
+ - [Linux Foundation project page](https://www.lfenergy.org/projects/openstef/);
79
79
  - [Documentation on dashboard](https://raw.githack.com/OpenSTEF/.github/main/profile/html/openstef_dashboard_doc.html);
80
- - [Linux Foundation project page](https://openstef.github.io/openstef/index.html)
81
80
  - [Video about OpenSTEF](https://www.lfenergy.org/forecasting-to-create-a-more-resilient-optimized-grid/);
82
- - [Teams channel](https://teams.microsoft.com/l/team/19%3ac08a513650524fc988afb296cd0358cc%40thread.tacv2/conversations?groupId=bfcb763a-3a97-4938-81d7-b14512aa537d&tenantId=697f104b-d7cb-48c8-ac9f-bd87105bafdc)
81
+ - [Teams channel](https://teams.microsoft.com/l/team/19%3ac08a513650524fc988afb296cd0358cc%40thread.tacv2/conversations?groupId=bfcb763a-3a97-4938-81d7-b14512aa537d&tenantId=697f104b-d7cb-48c8-ac9f-bd87105bafdc)
83
82
 
84
83
  # Installation
85
84
 
@@ -89,10 +88,6 @@ OpenSTEF is a Python package designed for generating short-term forecasts in the
89
88
  pip install openstef
90
89
  ```
91
90
 
92
- _**Optional**_: if you would like to use the proloaf model with OpenSTEF install the proloaf dependencies by running:
93
- ```shell
94
- pip install openstef[proloaf]
95
- ```
96
91
  ### Remark regarding installation within a **conda environment on Windows**:
97
92
 
98
93
  A version of the pywin32 package will be installed as a secondary dependency along with the installation of the openstef package. Since conda relies on an old version of pywin32, the new installation can break conda's functionality. The following command can solve this issue:
@@ -103,33 +98,34 @@ For more information on this issue see the [readme of pywin32](https://github.co
103
98
 
104
99
  # Usage
105
100
 
106
- To run a task use:
107
-
108
- ```shell
109
- python -m openstef task <task_name>
110
- ```
101
+ ## Example notebooks
102
+ To help you get started, a set of fundamental example notebooks has been created. You can access these offline examples [here](https://github.com/OpenSTEF/openstef-offline-example).
111
103
 
112
104
  ## Reference Implementation
113
105
  A complete implementation including databases, user interface, example data, etc. is available at: https://github.com/OpenSTEF/openstef-reference
114
106
 
115
107
  ![screenshot](https://user-images.githubusercontent.com/60883372/146760483-29af3ac7-62af-4f13-98c7-982a79c517d1.jpg)
116
108
  Screenshot of the operational dashboard showing the key functionality of OpenSTEF.
117
- Dashboard documentation can be found [here](https://github.com/OpenSTEF/.github/blob/main/profile/README.md).
109
+ Dashboard documentation can be found [here](https://raw.githack.com/OpenSTEF/.github/main/profile/html/openstef_dashboard_doc.html).
118
110
 
119
- ## Openstef-dbc - Database connector for openstef
120
- This repository provides an interface to OpenSTEF (reference) databases. The repository can be found [here](https://github.com/OpenSTEF/openstef-dbc).
111
+ To run a task use:
121
112
 
122
- ## Example notebooks
123
- To help you get started, a set of fundamental example notebooks has been created. You can access these offline examples [here](https://github.com/OpenSTEF/openstef-offline-example).
113
+ ```shell
114
+ python -m openstef task <task_name>
115
+ ```
116
+
117
+ ## Database connector for openstef
118
+ This repository provides an interface to OpenSTEF (reference) databases. The repository can be found [here](https://github.com/OpenSTEF/openstef-dbc).
124
119
 
125
- ## License
120
+ # License
126
121
  This project is licensed under the Mozilla Public License, version 2.0 - see LICENSE for details.
127
122
 
128
123
  ## Licenses third-party libraries
129
124
  This project includes third-party libraries, which are licensed under their own respective Open-Source licenses. SPDX-License-Identifier headers are used to show which license is applicable. The concerning license files can be found in the LICENSES directory.
130
125
 
131
- ## Contributing
126
+ # Contributing
132
127
  Please read [CODE_OF_CONDUCT.md](https://github.com/OpenSTEF/.github/blob/main/CODE_OF_CONDUCT.md), [CONTRIBUTING.md](https://github.com/OpenSTEF/.github/blob/main/CONTRIBUTING.md) and [PROJECT_GOVERNANCE.md](https://github.com/OpenSTEF/.github/blob/main/PROJECT_GOVERNANCE.md) for details on the process for submitting pull requests to us.
133
128
 
134
- ## Contact
129
+ # Contact
135
130
  Please read [SUPPORT.md](https://github.com/OpenSTEF/.github/blob/main/SUPPORT.md) for how to connect and get into contact with the OpenSTEF project
131
+
@@ -0,0 +1,91 @@
1
+ openstef/__init__.py,sha256=93UM6m0LLQhO69-mSqLuUy73jgs4W7Iuxfo3Lm8c98g,419
2
+ openstef/__main__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
3
+ openstef/app_settings.py,sha256=EJTDtimctFQQ-3f7ZcOQaRYohpZk3JD6aZBWPFYM2_A,582
4
+ openstef/enums.py,sha256=TTchQ0iZ3PXBjMVmVid_x7W-zU1jNiHa-4wDMGyNWic,755
5
+ openstef/exceptions.py,sha256=U4u2LTcdT6cmzpipT2Jh7kq9nCjT_-6gntn8yjuhGU0,1993
6
+ openstef/settings.py,sha256=nSgkBqFxuqB3w7Rwo60i8j37c5ngDbt6vpjHS6QtJXQ,354
7
+ openstef/data/dutch_holidays_2020-2022.csv,sha256=pS-CjE0igYXd-2dG-MlqyvR2fgYgXkbNmgCKyTjmwxs,23704
8
+ openstef/data/dutch_holidays_2020-2022.csv.license,sha256=AxxHusqwIXU5RHl5ZMU65LyXmgtbj6QlcnFaOEN4kEE,145
9
+ openstef/data/pv_single_coefs.csv,sha256=jadIEYdHvl1lnV_06X_FASkJZ6C3Hecs5xZnH1gPMvI,24779
10
+ openstef/data/pv_single_coefs.csv.license,sha256=AxxHusqwIXU5RHl5ZMU65LyXmgtbj6QlcnFaOEN4kEE,145
11
+ openstef/data_classes/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
12
+ openstef/data_classes/data_prep.py,sha256=gRSL7UiHvZis8m8z7VoTCZc0Ccffhef5_hmSyApnqK0,3417
13
+ openstef/data_classes/model_specifications.py,sha256=Uod1W3QzhRqVLb6zvXwxh9wRL3EHCzSvX0oDNd28cFk,1197
14
+ openstef/data_classes/prediction_job.py,sha256=tE3K8QCDasXh0ESOBvMgJ3yI_noS6Uz7jU0sSDdt_us,5232
15
+ openstef/data_classes/split_function.py,sha256=ljQIQQu1t1Y_CVWGAy25jrM6wG9odIVVQVimrT1n-1s,3358
16
+ openstef/feature_engineering/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
17
+ openstef/feature_engineering/apply_features.py,sha256=-3fyisOVj9ckIkRe2iYfWutbXSX8iqBkcvt8AYr-gmE,3906
18
+ openstef/feature_engineering/data_preparation.py,sha256=htca9LBO3ZN1D-iX4vXf0UN1fw_rRO7y6N3AuYVMpfk,5628
19
+ openstef/feature_engineering/feature_adder.py,sha256=aSqDl_gUrB3H2TD3cNvU5JniY_KOb4u4a2A6J7zB2BQ,6835
20
+ openstef/feature_engineering/feature_applicator.py,sha256=DR7jayrEMlra4BFL1Ps5WV2fxbkQ6VaOTa5RIKM-YNk,7447
21
+ openstef/feature_engineering/general.py,sha256=tgU4_1stag9jJmaQAfWCMhfBscznVuQvW5hPK_z9_9g,4438
22
+ openstef/feature_engineering/holiday_features.py,sha256=3Ff4Lkm26h8wJVoBplUewt4HfsvOUS9zj0x0MxewIm8,7842
23
+ openstef/feature_engineering/lag_features.py,sha256=Dr6qS8UhdgEHPZZSe-w6ibtjl_lcbcQohhqdZN9fqEU,5652
24
+ openstef/feature_engineering/missing_values_transformer.py,sha256=pKz_vRZRzfUNBw9Z-mF2AXRPeCzKbTha2gPb73bpkdw,3381
25
+ openstef/feature_engineering/weather_features.py,sha256=Lr9DItyHvJ2CpWQ1r6A83tJKtR2k_Wwn32FdFTGblO0,15750
26
+ openstef/metrics/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
27
+ openstef/metrics/figure.py,sha256=KDoezYem9wdS13kUx7M7FOy-4u88Sg3OX1DuhNT6kgQ,9751
28
+ openstef/metrics/metrics.py,sha256=si93EP2i34v3IPg-nOcm_aheoFAdu46i3azV_PjPmF8,15237
29
+ openstef/metrics/reporter.py,sha256=w1Q6xWoYGmvnjwjXik-Gz7_gnb0lOeJMep-whEV5mNk,7897
30
+ openstef/model/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
31
+ openstef/model/basecase.py,sha256=caI6Q-8y0ymlxGK9Js_H3Vh0q6ruNHlGD5RG0_kE5M0,2878
32
+ openstef/model/confidence_interval_applicator.py,sha256=Bx0mm4zGKlqopMZ589cVyDN_k6jfuyqtV1FoViXxc2Y,9775
33
+ openstef/model/fallback.py,sha256=VV9ehgnoMZtWzqKk9H1t8wnERFh5CyC4TvDIuRP_ZDI,2861
34
+ openstef/model/model_creator.py,sha256=v-_NHNG1MEQizg9ZKEkDxCdRKjqwg4Knpm-Yvd__1nE,5930
35
+ openstef/model/objective.py,sha256=2wPoONbk11WbySyPyqFMmXBx2lDFeUq_7jFPaCNETao,14572
36
+ openstef/model/objective_creator.py,sha256=_qIjq0ckrVIFr7k0L0NN0WyF0LIDaEYWA9NtVLzGs9g,2167
37
+ openstef/model/serializer.py,sha256=IUiiAWvoGVoWzmS-akI6LC7jHRY5Ln_vOCBZy1LnESY,17238
38
+ openstef/model/standard_deviation_generator.py,sha256=Od9bzXi2TLb1v8Nz-VhBMZHSopWH6ssaDe8gYLlqO1I,2911
39
+ openstef/model/metamodels/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
40
+ openstef/model/metamodels/grouped_regressor.py,sha256=yMN_a6TnQSyFaqlB_6Nifq-ydpb5hs6w_b97IaBbHj4,8337
41
+ openstef/model/metamodels/missing_values_handler.py,sha256=veyvYZHhKvlYZxaUpxRQ7XoE033_3Lcg9LrbuKchlOk,5241
42
+ openstef/model/regressors/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
43
+ openstef/model/regressors/arima.py,sha256=wt7FVykjSvljpl7vjtliq61SiyjQ7KKtw8PF9x0xf04,7587
44
+ openstef/model/regressors/custom_regressor.py,sha256=Hsmxahc9nfSWD0aEZ6cm4pxW2noQ8B1SujS17_fmxcU,1768
45
+ openstef/model/regressors/dazls.py,sha256=Xt89yFHjkwpIUTkkhPmPZ74F8_tht_XV88INuP5GU2E,3994
46
+ openstef/model/regressors/flatliner.py,sha256=98JUwRGtOYT9ZR9njY7FBCLNYTtAe7ZTcBF1cbSZyZg,3024
47
+ openstef/model/regressors/lgbm.py,sha256=zCdn1euEdSFxYJzH8XqQFFnb6R4JVUnmineKjX_Gy-g,800
48
+ openstef/model/regressors/linear.py,sha256=uOvZMLGZH_9nXfmS5honCMfyVeyGXP1Cza9A_BdXlVw,3665
49
+ openstef/model/regressors/linear_quantile.py,sha256=N-cia8aba39Th6BzOdtcESLuxhY9YtSGaOYIc6STgag,7830
50
+ openstef/model/regressors/regressor.py,sha256=uJcx59AyCPE9f_yPcAQ59h2ZS7eNsDpIHJrladKvHIw,3461
51
+ openstef/model/regressors/xgb.py,sha256=HggA1U10srzdysjV560BMMX66kfaxCKAnOZB3JyyT_Y,808
52
+ openstef/model/regressors/xgb_multioutput_quantile.py,sha256=xWzA7tymC_o-F1OS3I7vUKf9zP6RR1ZglEeY4NAgjU0,9146
53
+ openstef/model/regressors/xgb_quantile.py,sha256=PzKIxqN_CnEPFmzXACNuzLSmZSHbooTuiJ5ckJ9vh_E,7805
54
+ openstef/model_selection/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
55
+ openstef/model_selection/model_selection.py,sha256=R34tJBecZo6IiUwCCRLeBI2ZCX6GP8W7FDBlGFWtmG8,11167
56
+ openstef/monitoring/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
57
+ openstef/monitoring/performance_meter.py,sha256=6aCGjJFXFq-7qwaJyBkF3MLqjgVK6FMFVcO-bcLLUb4,2803
58
+ openstef/monitoring/teams.py,sha256=A-tlZeuAgolxFHjgT3gGjraxzW2dmuB-UAOz4xgYNIQ,6668
59
+ openstef/pipeline/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
60
+ openstef/pipeline/create_basecase_forecast.py,sha256=YkpiqohETTAETb4GiVlK_btw5dpixJy2LmFZdm10iaI,4623
61
+ openstef/pipeline/create_component_forecast.py,sha256=XlE9oo37qwmZPE2Dgg19CDfFPRKgrLuyW069pS035UQ,5668
62
+ openstef/pipeline/create_forecast.py,sha256=F09civdIumNQwJq2hraea5QTQx7DgvEliXKs4Y3f8Mc,5689
63
+ openstef/pipeline/optimize_hyperparameters.py,sha256=3SLkcLR7XC4IeN48C-XT_lxlfCqW_D0NoMpZcrB9UUM,11045
64
+ openstef/pipeline/train_create_forecast_backtest.py,sha256=-kZqCWal5zYLL0k0Sapks1zTmU5unNAooVPaPos1_7E,6050
65
+ openstef/pipeline/train_model.py,sha256=Bxtwb8xQvyEYIo-6D5yNvvXl3WfCZLY1ok8aqaKv6zg,19660
66
+ openstef/pipeline/utils.py,sha256=23mB31p19FoGWelLJzxNmqlzGwEr3fCDBEA37V2kpYY,2167
67
+ openstef/postprocessing/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
68
+ openstef/postprocessing/postprocessing.py,sha256=iR1dhfIqBSRl1NpQiMAceDsY-fHs1qnzDc-b5jFdzvc,9321
69
+ openstef/preprocessing/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
70
+ openstef/preprocessing/preprocessing.py,sha256=bM_cSSSb2vGTD79RGzUrI6KoELbzlCyJwc7jqQGNEsE,1454
71
+ openstef/tasks/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
72
+ openstef/tasks/calculate_kpi.py,sha256=78DuK30ohWIHuc6oneRXalcNMXQ5mzy2qDr9xsPdSQs,11882
73
+ openstef/tasks/create_basecase_forecast.py,sha256=Gk4Lsdh_wbGWx3rsJFHSu8akpckAjL92D_NUMFom-JA,4193
74
+ openstef/tasks/create_components_forecast.py,sha256=j4m9AGjnMDx23FmsaZGPYn9rBMHsRd_h-m1RAfhF8to,6139
75
+ openstef/tasks/create_forecast.py,sha256=NWd2fdbZ9CKDi190v7PF14IUdz6pyME2A-ssRNDdaYs,5750
76
+ openstef/tasks/create_solar_forecast.py,sha256=bTr7NThTF6Yj405qAqRaJmlBUrL7HATqVVzsi9hMdMw,15049
77
+ openstef/tasks/create_wind_forecast.py,sha256=RhshkmNSyFWx4Y6yQn02GzHjWTREbN5A5GAeWv0JpcE,2907
78
+ openstef/tasks/optimize_hyperparameters.py,sha256=s-z8YQJF6Lf3DdYgKHEpAdlbFJ3a-0Gj0Ahsqj1DErc,4758
79
+ openstef/tasks/split_forecast.py,sha256=1MBi1kKYR6R3H-NMo4At_0SdpVamWnT5sUXffRX84dI,9327
80
+ openstef/tasks/train_model.py,sha256=3-7QzyOFQ2jK_RHd7ISpFRnn0V9yEHCWQN3O8qLglqc,7475
81
+ openstef/tasks/utils/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
82
+ openstef/tasks/utils/dependencies.py,sha256=Jy9dtV_G7lTEa5Cdy--wvMxJuAb0adb3R0X4QDjVteM,3077
83
+ openstef/tasks/utils/predictionjobloop.py,sha256=Ysy3zF5lzPMz_asYDKeF5m0qgVT3tCtwSPihqMjnI5Q,9580
84
+ openstef/tasks/utils/taskcontext.py,sha256=L9K14ycwgVxbIVUjH2DIn_QWbnu-OfxcGtQ1K9T6sus,5630
85
+ openstef/validation/__init__.py,sha256=bIyGTSA4V5VoOLTwdaiJJAnozmpSzvQooVYlsf8H4eU,163
86
+ openstef/validation/validation.py,sha256=628xaDbAm8B4AYtFOAn8_SXLjejNfULGCfX3hVf_mU0,11119
87
+ openstef-3.4.29.dist-info/LICENSE,sha256=7Pm2fWFFHHUG5lDHed1vl5CjzxObIXQglnYsEdtjo_k,14907
88
+ openstef-3.4.29.dist-info/METADATA,sha256=cg41zQTsRW3UAfGEPOqXrA3S0a8pUEWsw1Dy8eCjU0A,7392
89
+ openstef-3.4.29.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
90
+ openstef-3.4.29.dist-info/top_level.txt,sha256=kD0H4PqrQoncZ957FvqwfBxa89kTrun4Z_RAPs_HhLs,9
91
+ openstef-3.4.29.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,3 +0,0 @@
1
- SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
-
3
- SPDX-License-Identifier: MPL-2.0
@@ -1,3 +0,0 @@
1
- SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
-
3
- SPDX-License-Identifier: MPL-2.0
@@ -1,3 +0,0 @@
1
- SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
-
3
- SPDX-License-Identifier: MPL-2.0
@@ -1,3 +0,0 @@
1
- SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
-
3
- SPDX-License-Identifier: MPL-2.0
@@ -1,2 +0,0 @@
1
- x^%�;
2
- �0DS����#U�}� $c��
@@ -1,3 +0,0 @@
1
- SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
-
3
- SPDX-License-Identifier: MPL-2.0
@@ -1,3 +0,0 @@
1
- SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
-
3
- SPDX-License-Identifier: MPL-2.0
@@ -1,3 +0,0 @@
1
- SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
-
3
- SPDX-License-Identifier: MPL-2.0
@@ -1,6 +0,0 @@
1
- x^�SMOAnKK�RhL<��ㅰ��j��dvw`Wwgwf�B
2
- �<zBO� �6��.6��:�\��( =Ā����}�u ׼�ǔ��+G�K���
3
- ���X]�f�.dL�L�J�,�`���x��0�R�r�SK>���ro�uyo�!�J�N�͍uQ%��'�D�\��)G<�Z( �@�����@l���8��3�=�C`�CĄ^��)3���O����Љ�
4
- ���1 i� �h���d�$��*I���-d2�h���j�A��N��0t�ɬ��
5
- ɮ��
6
- ɕ��̒(-�8?�tWS?;A�2?�S!�2Øk�gI���-�W����[���E���<3߅�y1�Br�P��E����l���x����2����^2���,� �|�V��oD�؃�q{�>�Ss�q� i�=�a���r:��ʓ�W�Ƿ������Z�t[Wڋ��7V�7O>�i���.>�9д������q�͗���4�"|���O=��^3K�o������D���}��~j����|�_Yy�5����c}q��1+ܲ�=�2��Y�S��dc��W��we��e㌩��YQ3�_���
@@ -1,3 +0,0 @@
1
- SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <korte.termijn.prognoses@alliander.com>
2
-
3
- SPDX-License-Identifier: MPL-2.0
@@ -1,40 +0,0 @@
1
- # SPDX-FileCopyrightText: 2017-2023 Alliander N.V. <korte.termijn.prognoses@alliander.com> # noqa E501>
2
- #
3
- # SPDX-License-Identifier: MPL-2.0
4
-
5
- """This module contains historic load related functions used for feature engineering."""
6
-
7
- import pandas as pd
8
- import structlog
9
-
10
- from openstef.data_classes.prediction_job import PredictionJobDataClass
11
-
12
-
13
- def add_historic_load_as_a_feature(
14
- data: pd.DataFrame,
15
- pj: PredictionJobDataClass = None,
16
- ) -> pd.DataFrame:
17
- """Adds additional proloaf features to the input data, historic_load (equal to the load).
18
-
19
- Args:
20
- data: Dataframe to which the wind features have to be added
21
- pj: Prediction job.
22
-
23
- Returns:
24
- DataFrame that is the same as input dataframe with extra columns for the added proloaf features
25
-
26
- """
27
- logger = structlog.get_logger(__name__)
28
-
29
- if pj is None:
30
- pj = {}
31
-
32
- if pj.get("model") == "proloaf":
33
- data["historic_load"] = data["load"]
34
- logger.warning(
35
- "The historic_load is added to the data, this is a copy of the load. Adding"
36
- " this feature is in most of the cases not a good idea, it is designed for"
37
- " the proloaf model."
38
- )
39
-
40
- return data
@@ -1,281 +0,0 @@
1
- # SPDX-FileCopyrightText: 2017-2023 Alliander N.V. <korte.termijn.prognoses@alliander.com> # noqa E501>
2
- #
3
- # SPDX-License-Identifier: MPL-2.0
4
- from typing import Any, Union
5
-
6
- import numpy as np
7
- import pandas as pd
8
-
9
- # These imports will require the proloaf optional dependencies to be installed
10
- import proloaf.datahandler as dh
11
- import torch
12
- from proloaf.modelhandler import ModelWrapper
13
-
14
- from openstef.model.regressors.regressor import OpenstfRegressor
15
-
16
- # TODO: implement the hyperparameter optimalisation via optuna
17
- # TODO: set the default for hyperparameters in the init of OpenstfProloafRegressor
18
- # TODO: implement function for defining encoder and decoder features
19
-
20
-
21
- def divide_scaling_groups(x: pd.DataFrame) -> tuple[list[str], list[str], list[str]]:
22
- """Divides the column names over different type of scaling groups.
23
-
24
- Args:
25
- x: Dataframe from which columns have to be divided
26
-
27
- Returns:
28
- List of all the grouped features for scaling (three groups)
29
-
30
- """
31
- minmax_scale_features = []
32
- oh_scale_features = []
33
- no_scale_features = []
34
-
35
- for column in x.columns:
36
- if (x[column].min() <= -1) or (x[column].max() >= 1):
37
- minmax_scale_features.append(column)
38
- elif x[column].dtype == "bool":
39
- oh_scale_features.append(column)
40
- else:
41
- no_scale_features.append(column)
42
-
43
- return minmax_scale_features, oh_scale_features, no_scale_features
44
-
45
-
46
- def apply_scaling(
47
- scaler_features: tuple[list[str], list[str], list[str]],
48
- data: pd.DataFrame,
49
- scalers=None,
50
- ):
51
- """Applies different scaling methods to a certain dataframe (minmax, one hot, or no scaling).
52
-
53
- Args:
54
- scaler_features: Three different lists with features for each scaling
55
- x: Dataframe from which columns have to be divided
56
- scalers: scalers resulting from the previous scaling
57
-
58
- Returns:
59
- Dataframe with all the scaled features
60
-
61
- """
62
- selected_features, scalers = dh.scale_all(
63
- data,
64
- scalers=scalers,
65
- feature_groups=[
66
- {
67
- "name": "main",
68
- "scaler": ["minmax", -1.0, 1.0],
69
- "features": scaler_features[0],
70
- },
71
- {"name": "aux", "scaler": None, "features": scaler_features[2]},
72
- ],
73
- )
74
-
75
- # One hot encoding certain features
76
- onehot_feature_groups = [
77
- {
78
- "name": "main",
79
- "scaler": [
80
- "onehot",
81
- ],
82
- "features": scaler_features[1],
83
- }
84
- ]
85
- for group in onehot_feature_groups:
86
- df_onehot = data.filter(group["features"])
87
- result_oh_scale = np.transpose(np.array(df_onehot.iloc[:, :], dtype=np.int))
88
- df_onehot.iloc[:, :] = result_oh_scale.T
89
-
90
- if not df_onehot.columns.empty:
91
- selected_features = pd.concat([selected_features, df_onehot], axis=1)
92
- data = selected_features.iloc[:, :].replace(np.nan, 0)
93
-
94
- return data, scalers
95
-
96
-
97
- class OpenstfProloafRegressor(OpenstfRegressor, ModelWrapper):
98
- def __init__(
99
- self,
100
- name: str = "model",
101
- core_net: str = "torch.nn.LSTM",
102
- relu_leak: float = 0.1,
103
- encoder_features: list[str] = [
104
- "historic_load",
105
- ], # make sure historic load is present, TODO: implement so you can use None
106
- decoder_features: list[str] = [
107
- "air_density"
108
- ], # TODO: implement so you can use None
109
- core_layers: int = 1,
110
- rel_linear_hidden_size: float = 1.0,
111
- rel_core_hidden_size: float = 1.0,
112
- dropout_fc: float = 0.4,
113
- dropout_core: float = 0.3,
114
- training_metric: str = "nllgauss",
115
- metric_options: dict[str, Any] = {},
116
- optimizer_name: str = "adam",
117
- early_stopping_patience: int = 7,
118
- early_stopping_margin: float = 0,
119
- learning_rate: float = 1e-3,
120
- max_epochs: int = 100,
121
- device: Union[str, int] = "cpu", # "cuda" or "cpu"
122
- batch_size: int = 6,
123
- history_horizon: int = 24,
124
- horizon_minutes: int = 2880, # 2 days in minutes,
125
- ):
126
- self.device = device
127
- self.batch_size = batch_size
128
- self.history_horizon = history_horizon
129
- self.forecast_horizon = int(horizon_minutes / 60)
130
- ModelWrapper.__init__(
131
- self,
132
- name=name,
133
- core_net=core_net,
134
- relu_leak=relu_leak,
135
- encoder_features=encoder_features,
136
- decoder_features=decoder_features,
137
- core_layers=core_layers,
138
- rel_linear_hidden_size=rel_linear_hidden_size,
139
- rel_core_hidden_size=rel_core_hidden_size,
140
- dropout_fc=dropout_fc,
141
- dropout_core=dropout_core,
142
- training_metric=training_metric,
143
- metric_options=metric_options,
144
- optimizer_name=optimizer_name,
145
- early_stopping_patience=early_stopping_patience,
146
- early_stopping_margin=early_stopping_margin,
147
- learning_rate=learning_rate,
148
- max_epochs=max_epochs,
149
- )
150
- self.to(device)
151
-
152
- @property
153
- def feature_names(self):
154
- return (
155
- ["load"] + self.encoder_features + self.decoder_features
156
- ) # TODO: gehele range, of een enkele feature
157
-
158
- @property
159
- def can_predict_quantiles(self):
160
- return False
161
-
162
- def predict(self, x: pd.DataFrame) -> np.ndarray:
163
- x = x[list(self.feature_names)[1:]]
164
- # Apply scaling and interpolation for NaN values
165
- x = dh.fill_if_missing(x, periodicity=24)
166
- x, _ = apply_scaling(
167
- [
168
- self.minmax_scale_features,
169
- self.oh_scale_features,
170
- self.no_scale_features,
171
- ],
172
- x,
173
- self.scalers,
174
- )
175
-
176
- inputs_enc = torch.tensor(
177
- x[self.encoder_features].to_numpy(), dtype=torch.float
178
- ).unsqueeze(dim=0)
179
- inputs_dec = torch.tensor(
180
- x[self.decoder_features].to_numpy(), dtype=torch.float
181
- ).unsqueeze(dim=0)
182
- prediction = (
183
- ModelWrapper.predict(self, inputs_enc, inputs_dec)[:, :, 0]
184
- .squeeze()
185
- .detach()
186
- .numpy()
187
- )
188
-
189
- return prediction
190
-
191
- def fit(
192
- self,
193
- x: pd.DataFrame,
194
- y: pd.DataFrame,
195
- eval_set: tuple = None,
196
- early_stopping_rounds: int = None,
197
- verbose: bool = False,
198
- **kwargs,
199
- ) -> ModelWrapper:
200
- x = x[list(self.feature_names)[1:]]
201
- # Apply scaling and interpolation for NaN values
202
- x = dh.fill_if_missing(x, periodicity=24)
203
- (
204
- self.minmax_scale_features,
205
- self.oh_scale_features,
206
- self.no_scale_features,
207
- ) = divide_scaling_groups(x)
208
- x, self.scalers = apply_scaling(
209
- [
210
- self.minmax_scale_features,
211
- self.oh_scale_features,
212
- self.no_scale_features,
213
- ],
214
- x,
215
- self.scalers,
216
- )
217
- y = y.to_frame()
218
- self.target_id = [y.columns[0]]
219
-
220
- df_train = pd.concat([x, y], axis="columns", verify_integrity=True)
221
-
222
- print(f"{self.encoder_features = }")
223
- print(f"{self.decoder_features = }")
224
-
225
- train_dl, _, _ = dh.transform(
226
- df=df_train,
227
- encoder_features=self.encoder_features,
228
- decoder_features=self.decoder_features,
229
- batch_size=self.batch_size,
230
- history_horizon=self.history_horizon,
231
- forecast_horizon=self.forecast_horizon,
232
- target_id=self.target_id,
233
- train_split=1.0,
234
- validation_split=1.0,
235
- device=self.device,
236
- )
237
-
238
- val_x, val_y = eval_set[1][0], eval_set[1][1]
239
- val_x = dh.fill_if_missing(val_x, periodicity=24)
240
- val_x, _ = apply_scaling(
241
- [
242
- self.minmax_scale_features,
243
- self.oh_scale_features,
244
- self.no_scale_features,
245
- ],
246
- val_x,
247
- self.scalers,
248
- )
249
-
250
- df_val = pd.concat([val_x, val_y], axis="columns", verify_integrity=True)
251
- _, validation_dl, _ = dh.transform(
252
- df=df_val,
253
- encoder_features=self.encoder_features,
254
- decoder_features=self.decoder_features,
255
- batch_size=self.batch_size,
256
- history_horizon=self.history_horizon,
257
- forecast_horizon=self.forecast_horizon,
258
- target_id=self.target_id,
259
- train_split=0.0,
260
- validation_split=1.0,
261
- device=self.device,
262
- )
263
- self.to(self.device)
264
- self.init_model()
265
- self.is_fitted_ = True
266
-
267
- return self.run_training(train_dl, validation_dl)
268
-
269
- def get_params(self, deep=True):
270
- model_params = self.get_model_config()
271
- training_params = self.get_training_config()
272
- return {**model_params, **training_params}
273
-
274
- def set_params(self, **params):
275
- self.update(**params)
276
- return self
277
-
278
-
279
- if __name__ == "__main__":
280
- test = OpenstfProloafRegressor()
281
- print(test)