hypertrees-forecasting 0.1.0__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.
Files changed (25) hide show
  1. hypertrees_forecasting-0.1.0/LICENSE +228 -0
  2. hypertrees_forecasting-0.1.0/PKG-INFO +427 -0
  3. hypertrees_forecasting-0.1.0/README.md +150 -0
  4. hypertrees_forecasting-0.1.0/hypertrees/__init__.py +1 -0
  5. hypertrees_forecasting-0.1.0/hypertrees/models/HyperTreeAR.py +631 -0
  6. hypertrees_forecasting-0.1.0/hypertrees/models/HyperTreeETS.py +1011 -0
  7. hypertrees_forecasting-0.1.0/hypertrees/models/HyperTreeNetAR.py +916 -0
  8. hypertrees_forecasting-0.1.0/hypertrees/models/HyperTreeSTL.py +806 -0
  9. hypertrees_forecasting-0.1.0/hypertrees/models/__init__.py +6 -0
  10. hypertrees_forecasting-0.1.0/hypertrees/models/mlp.py +79 -0
  11. hypertrees_forecasting-0.1.0/hypertrees/utils.py +456 -0
  12. hypertrees_forecasting-0.1.0/hypertrees_forecasting.egg-info/PKG-INFO +427 -0
  13. hypertrees_forecasting-0.1.0/hypertrees_forecasting.egg-info/SOURCES.txt +23 -0
  14. hypertrees_forecasting-0.1.0/hypertrees_forecasting.egg-info/dependency_links.txt +1 -0
  15. hypertrees_forecasting-0.1.0/hypertrees_forecasting.egg-info/requires.txt +29 -0
  16. hypertrees_forecasting-0.1.0/hypertrees_forecasting.egg-info/top_level.txt +1 -0
  17. hypertrees_forecasting-0.1.0/hypertrees_forecasting.egg-info/zip-safe +1 -0
  18. hypertrees_forecasting-0.1.0/pyproject.toml +108 -0
  19. hypertrees_forecasting-0.1.0/setup.cfg +4 -0
  20. hypertrees_forecasting-0.1.0/tests/test_hypertree_ar.py +1084 -0
  21. hypertrees_forecasting-0.1.0/tests/test_hypertree_ets.py +786 -0
  22. hypertrees_forecasting-0.1.0/tests/test_hypertree_net_ar.py +1209 -0
  23. hypertrees_forecasting-0.1.0/tests/test_hypertree_stl.py +645 -0
  24. hypertrees_forecasting-0.1.0/tests/test_mlp.py +743 -0
  25. hypertrees_forecasting-0.1.0/tests/test_utils.py +356 -0
@@ -0,0 +1,228 @@
1
+ Commons Clause License Condition v1.0
2
+
3
+ The Software is provided to you by the Licensor under the License, as
4
+ defined below, subject to the following condition.
5
+
6
+ Without limiting other conditions in the License, the grant of rights
7
+ under the License will not include, and the License does not grant to
8
+ you, the right to Sell the Software.
9
+
10
+ For purposes of the foregoing, "Sell" means practicing any or all of
11
+ the rights granted to you under the License to provide to third
12
+ parties, for a fee or other consideration, a product or service whose
13
+ value derives, entirely or substantially, from the functionality of
14
+ the Software. For the avoidance of doubt, consulting or support
15
+ services where the Software is a tool rather than the delivered
16
+ product are not considered "Sell" under this condition.
17
+
18
+ For clarity: You MAY use the Software for research, academic,
19
+ testing, and production purposes, including for internal commercial
20
+ use and integration into larger products or services, as long as you
21
+ are not selling access to the Software's functionality itself as a
22
+ primary offering (e.g., as an API service, managed service, or hosted
23
+ offering where the Software provides the primary value).
24
+
25
+ Any license notice or attribution required by the License must also
26
+ include this Commons Clause License Condition notice.
27
+
28
+ Software: Hyper-Trees
29
+
30
+ License: Apache License 2.0
31
+
32
+ Licensor: Alexander März
33
+
34
+ ---
35
+
36
+ Apache License
37
+ Version 2.0, January 2004
38
+ http://www.apache.org/licenses/
39
+
40
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
41
+
42
+ 1. Definitions.
43
+
44
+ "License" shall mean the terms and conditions for use, reproduction,
45
+ and distribution as defined by Sections 1 through 9 of this document,
46
+ together with the Commons Clause License Condition set forth above.
47
+
48
+ "Licensor" shall mean the copyright owner or entity authorized by the
49
+ copyright owner that is granting the License.
50
+
51
+ "Legal Entity" shall mean the union of the acting entity and all other
52
+ entities that control, are controlled by, or are under common control
53
+ with that entity. For the purposes of this definition, "control" means
54
+ (i) the power, direct or indirect, to cause the direction or
55
+ management of such entity, whether by contract or otherwise, or (ii)
56
+ ownership of fifty percent (50%) or more of the outstanding shares, or
57
+ (iii) beneficial ownership of such entity.
58
+
59
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
60
+ permissions granted by this License.
61
+
62
+ "Source" form shall mean the preferred form for making modifications,
63
+ including but not limited to software source code, documentation
64
+ source, and configuration files.
65
+
66
+ "Object" form shall mean any form resulting from mechanical
67
+ transformation or translation of a Source form, including but not
68
+ limited to compiled object code, generated documentation, and
69
+ conversions to other media types.
70
+
71
+ "Work" shall mean the work of authorship, whether in Source or Object
72
+ form, made available under the License, as indicated by a copyright
73
+ notice that is included in or attached to the work.
74
+
75
+ "Derivative Works" shall mean any work, whether in Source or Object
76
+ form, that is based on (or derived from) the Work and for which the
77
+ editorial revisions, annotations, elaborations, or other modifications
78
+ represent, as a whole, an original work of authorship. For the
79
+ purposes of this License, Derivative Works shall not include works
80
+ that remain separable from, or merely link (or bind by name) to the
81
+ interfaces of, the Work and Derivative Works thereof.
82
+
83
+ "Contribution" shall mean any work of authorship, including the
84
+ original version of the Work and any modifications or additions to
85
+ that Work or Derivative Works thereof, that is intentionally submitted
86
+ to the Licensor for inclusion in the Work by the copyright owner or by
87
+ an individual or Legal Entity authorized to submit on behalf of the
88
+ copyright owner. For the purposes of this definition, "submitted"
89
+ means any form of electronic, verbal, or written communication sent to
90
+ the Licensor or its representatives, including but not limited to
91
+ communication on electronic mailing lists, source code control
92
+ systems, and issue tracking systems that are managed by, or on behalf
93
+ of, the Licensor for the purpose of discussing and improving the Work,
94
+ but excluding communication that is conspicuously marked or otherwise
95
+ designated in writing by the copyright owner as "Not a Contribution."
96
+
97
+ "Contributor" shall mean Licensor and any individual or Legal Entity on
98
+ behalf of whom a Contribution has been received by the Licensor and
99
+ subsequently incorporated within the Work.
100
+
101
+ 2. Grant of Copyright License. Subject to the terms and conditions of
102
+ this License (including the Commons Clause License Condition), each
103
+ Contributor hereby grants to You a perpetual, worldwide,
104
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license
105
+ to reproduce, prepare Derivative Works of, publicly display, publicly
106
+ perform, sublicense, and distribute the Work and such Derivative Works
107
+ in Source or Object form.
108
+
109
+ 3. Grant of Patent License. Subject to the terms and conditions of
110
+ this License (including the Commons Clause License Condition), each
111
+ Contributor hereby grants to You a perpetual, worldwide,
112
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated
113
+ in this section) patent license to make, have made, use, offer to
114
+ sell, sell, import, and otherwise transfer the Work, where such
115
+ license applies only to those patent claims licensable by such
116
+ Contributor that are necessarily infringed by their Contribution(s)
117
+ alone or by combination of their Contribution(s) with the Work to
118
+ which such Contribution(s) was submitted. If You institute patent
119
+ litigation against any entity (including a cross-claim or counterclaim
120
+ in a lawsuit) alleging that the Work or a Contribution incorporated
121
+ within the Work constitutes direct or contributory patent
122
+ infringement, then any patent licenses granted to You under this
123
+ License for that Work shall terminate as of the date such litigation
124
+ is filed.
125
+
126
+ 4. Redistribution. You may reproduce and distribute copies of the Work
127
+ or Derivative Works thereof in any medium, with or without
128
+ modifications, and in Source or Object form, provided that You meet
129
+ the following conditions:
130
+
131
+ (a) You must give any other recipients of the Work or Derivative Works
132
+ a copy of this License (including the Commons Clause License
133
+ Condition); and
134
+
135
+ (b) You must cause any modified files to carry prominent notices
136
+ stating that You changed the files; and
137
+
138
+ (c) You must retain, in the Source form of any Derivative Works that
139
+ You distribute, all copyright, patent, trademark, and attribution
140
+ notices from the Source form of the Work, excluding those notices
141
+ that do not pertain to any part of the Derivative Works; and
142
+
143
+ (d) If the Work includes a "NOTICE" text file as part of its
144
+ distribution, then any Derivative Works that You distribute must
145
+ include a readable copy of the attribution notices contained
146
+ within such NOTICE file, excluding any notices that do not pertain
147
+ to any part of the Derivative Works, in at least one of the
148
+ following places: within a NOTICE text file distributed as part of
149
+ the Derivative Works; within the Source form or documentation, if
150
+ provided along with the Derivative Works; or, within a display
151
+ generated by the Derivative Works, if and wherever such
152
+ third-party notices normally appear. The contents of the NOTICE
153
+ file are for informational purposes only and do not modify the
154
+ License. You may add Your own attribution notices within Derivative
155
+ Works that You distribute, alongside or as an addendum to the
156
+ NOTICE text from the Work, provided that such additional
157
+ attribution notices cannot be construed as modifying the License.
158
+
159
+ You may add Your own copyright statement to Your modifications and may
160
+ provide additional or different license terms and conditions for use,
161
+ reproduction, or distribution of Your modifications, or for any such
162
+ Derivative Works as a whole, provided Your use, reproduction, and
163
+ distribution of the Work otherwise complies with the conditions stated
164
+ in this License (including the Commons Clause License Condition).
165
+
166
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
167
+ any Contribution intentionally submitted for inclusion in the Work by
168
+ You to the Licensor shall be under the terms and conditions of this
169
+ License, without any additional terms or conditions. Notwithstanding
170
+ the above, nothing herein shall supersede or modify the terms of any
171
+ separate license agreement you may have executed with Licensor
172
+ regarding such Contributions.
173
+
174
+ 6. Trademarks. This License does not grant permission to use the trade
175
+ names, trademarks, service marks, or product names of the Licensor,
176
+ except as required for reasonable and customary use in describing the
177
+ origin of the Work and reproducing the content of the NOTICE file.
178
+
179
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed
180
+ to in writing, Licensor provides the Work (and each Contributor
181
+ provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR
182
+ CONDITIONS OF ANY KIND, either express or implied, including, without
183
+ limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
184
+ MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
185
+ responsible for determining the appropriateness of using or
186
+ redistributing the Work and assume any risks associated with Your
187
+ exercise of permissions under this License.
188
+
189
+ 8. Limitation of Liability. In no event and under no legal theory,
190
+ whether in tort (including negligence), contract, or otherwise, unless
191
+ required by applicable law (such as deliberate and grossly negligent
192
+ acts) or agreed to in writing, shall any Contributor be liable to You
193
+ for damages, including any direct, indirect, special, incidental, or
194
+ consequential damages of any character arising as a result of this
195
+ License or out of the use or inability to use the Work (including but
196
+ not limited to damages for loss of goodwill, work stoppage, computer
197
+ failure or malfunction, or any and all other commercial damages or
198
+ losses), even if such Contributor has been advised of the possibility
199
+ of such damages.
200
+
201
+ 9. Accepting Warranty or Additional Liability. While redistributing
202
+ the Work or Derivative Works thereof, You may choose to offer, and
203
+ charge a fee for, acceptance of support, warranty, indemnity, or other
204
+ liability obligations and/or rights consistent with this License
205
+ (including the Commons Clause License Condition). However, in
206
+ accepting such obligations, You may act only on Your own behalf and on
207
+ Your sole responsibility, not on behalf of any other Contributor, and
208
+ only if You agree to indemnify, defend, and hold each Contributor
209
+ harmless for any liability incurred by, or claims asserted against,
210
+ such Contributor by reason of your accepting any such warranty or
211
+ additional liability.
212
+
213
+ END OF TERMS AND CONDITIONS
214
+
215
+ Copyright 2026 Alexander März
216
+
217
+ Licensed under the Apache License, Version 2.0, with Commons Clause
218
+ License Condition v1.0 (the "License"); you may not use this file
219
+ except in compliance with the License. You may obtain a copy of the
220
+ License at
221
+
222
+ http://www.apache.org/licenses/LICENSE-2.0
223
+
224
+ Unless required by applicable law or agreed to in writing, software
225
+ distributed under the License is distributed on an "AS IS" BASIS,
226
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
227
+ implied. See the License for the specific language governing
228
+ permissions and limitations under the License.
@@ -0,0 +1,427 @@
1
+ Metadata-Version: 2.4
2
+ Name: hypertrees-forecasting
3
+ Version: 0.1.0
4
+ Summary: Forecasting with Hyper-Trees
5
+ Author-email: Alexander März <statmixedmlgit@gmail.com>, Kashif Rasul <rasul.kashif@morganstanley.com>
6
+ Maintainer-email: Alexander März <statmixedmlgit@gmail.com>
7
+ License: Commons Clause License Condition v1.0
8
+
9
+ The Software is provided to you by the Licensor under the License, as
10
+ defined below, subject to the following condition.
11
+
12
+ Without limiting other conditions in the License, the grant of rights
13
+ under the License will not include, and the License does not grant to
14
+ you, the right to Sell the Software.
15
+
16
+ For purposes of the foregoing, "Sell" means practicing any or all of
17
+ the rights granted to you under the License to provide to third
18
+ parties, for a fee or other consideration, a product or service whose
19
+ value derives, entirely or substantially, from the functionality of
20
+ the Software. For the avoidance of doubt, consulting or support
21
+ services where the Software is a tool rather than the delivered
22
+ product are not considered "Sell" under this condition.
23
+
24
+ For clarity: You MAY use the Software for research, academic,
25
+ testing, and production purposes, including for internal commercial
26
+ use and integration into larger products or services, as long as you
27
+ are not selling access to the Software's functionality itself as a
28
+ primary offering (e.g., as an API service, managed service, or hosted
29
+ offering where the Software provides the primary value).
30
+
31
+ Any license notice or attribution required by the License must also
32
+ include this Commons Clause License Condition notice.
33
+
34
+ Software: Hyper-Trees
35
+
36
+ License: Apache License 2.0
37
+
38
+ Licensor: Alexander März
39
+
40
+ ---
41
+
42
+ Apache License
43
+ Version 2.0, January 2004
44
+ http://www.apache.org/licenses/
45
+
46
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
47
+
48
+ 1. Definitions.
49
+
50
+ "License" shall mean the terms and conditions for use, reproduction,
51
+ and distribution as defined by Sections 1 through 9 of this document,
52
+ together with the Commons Clause License Condition set forth above.
53
+
54
+ "Licensor" shall mean the copyright owner or entity authorized by the
55
+ copyright owner that is granting the License.
56
+
57
+ "Legal Entity" shall mean the union of the acting entity and all other
58
+ entities that control, are controlled by, or are under common control
59
+ with that entity. For the purposes of this definition, "control" means
60
+ (i) the power, direct or indirect, to cause the direction or
61
+ management of such entity, whether by contract or otherwise, or (ii)
62
+ ownership of fifty percent (50%) or more of the outstanding shares, or
63
+ (iii) beneficial ownership of such entity.
64
+
65
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
66
+ permissions granted by this License.
67
+
68
+ "Source" form shall mean the preferred form for making modifications,
69
+ including but not limited to software source code, documentation
70
+ source, and configuration files.
71
+
72
+ "Object" form shall mean any form resulting from mechanical
73
+ transformation or translation of a Source form, including but not
74
+ limited to compiled object code, generated documentation, and
75
+ conversions to other media types.
76
+
77
+ "Work" shall mean the work of authorship, whether in Source or Object
78
+ form, made available under the License, as indicated by a copyright
79
+ notice that is included in or attached to the work.
80
+
81
+ "Derivative Works" shall mean any work, whether in Source or Object
82
+ form, that is based on (or derived from) the Work and for which the
83
+ editorial revisions, annotations, elaborations, or other modifications
84
+ represent, as a whole, an original work of authorship. For the
85
+ purposes of this License, Derivative Works shall not include works
86
+ that remain separable from, or merely link (or bind by name) to the
87
+ interfaces of, the Work and Derivative Works thereof.
88
+
89
+ "Contribution" shall mean any work of authorship, including the
90
+ original version of the Work and any modifications or additions to
91
+ that Work or Derivative Works thereof, that is intentionally submitted
92
+ to the Licensor for inclusion in the Work by the copyright owner or by
93
+ an individual or Legal Entity authorized to submit on behalf of the
94
+ copyright owner. For the purposes of this definition, "submitted"
95
+ means any form of electronic, verbal, or written communication sent to
96
+ the Licensor or its representatives, including but not limited to
97
+ communication on electronic mailing lists, source code control
98
+ systems, and issue tracking systems that are managed by, or on behalf
99
+ of, the Licensor for the purpose of discussing and improving the Work,
100
+ but excluding communication that is conspicuously marked or otherwise
101
+ designated in writing by the copyright owner as "Not a Contribution."
102
+
103
+ "Contributor" shall mean Licensor and any individual or Legal Entity on
104
+ behalf of whom a Contribution has been received by the Licensor and
105
+ subsequently incorporated within the Work.
106
+
107
+ 2. Grant of Copyright License. Subject to the terms and conditions of
108
+ this License (including the Commons Clause License Condition), each
109
+ Contributor hereby grants to You a perpetual, worldwide,
110
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license
111
+ to reproduce, prepare Derivative Works of, publicly display, publicly
112
+ perform, sublicense, and distribute the Work and such Derivative Works
113
+ in Source or Object form.
114
+
115
+ 3. Grant of Patent License. Subject to the terms and conditions of
116
+ this License (including the Commons Clause License Condition), each
117
+ Contributor hereby grants to You a perpetual, worldwide,
118
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated
119
+ in this section) patent license to make, have made, use, offer to
120
+ sell, sell, import, and otherwise transfer the Work, where such
121
+ license applies only to those patent claims licensable by such
122
+ Contributor that are necessarily infringed by their Contribution(s)
123
+ alone or by combination of their Contribution(s) with the Work to
124
+ which such Contribution(s) was submitted. If You institute patent
125
+ litigation against any entity (including a cross-claim or counterclaim
126
+ in a lawsuit) alleging that the Work or a Contribution incorporated
127
+ within the Work constitutes direct or contributory patent
128
+ infringement, then any patent licenses granted to You under this
129
+ License for that Work shall terminate as of the date such litigation
130
+ is filed.
131
+
132
+ 4. Redistribution. You may reproduce and distribute copies of the Work
133
+ or Derivative Works thereof in any medium, with or without
134
+ modifications, and in Source or Object form, provided that You meet
135
+ the following conditions:
136
+
137
+ (a) You must give any other recipients of the Work or Derivative Works
138
+ a copy of this License (including the Commons Clause License
139
+ Condition); and
140
+
141
+ (b) You must cause any modified files to carry prominent notices
142
+ stating that You changed the files; and
143
+
144
+ (c) You must retain, in the Source form of any Derivative Works that
145
+ You distribute, all copyright, patent, trademark, and attribution
146
+ notices from the Source form of the Work, excluding those notices
147
+ that do not pertain to any part of the Derivative Works; and
148
+
149
+ (d) If the Work includes a "NOTICE" text file as part of its
150
+ distribution, then any Derivative Works that You distribute must
151
+ include a readable copy of the attribution notices contained
152
+ within such NOTICE file, excluding any notices that do not pertain
153
+ to any part of the Derivative Works, in at least one of the
154
+ following places: within a NOTICE text file distributed as part of
155
+ the Derivative Works; within the Source form or documentation, if
156
+ provided along with the Derivative Works; or, within a display
157
+ generated by the Derivative Works, if and wherever such
158
+ third-party notices normally appear. The contents of the NOTICE
159
+ file are for informational purposes only and do not modify the
160
+ License. You may add Your own attribution notices within Derivative
161
+ Works that You distribute, alongside or as an addendum to the
162
+ NOTICE text from the Work, provided that such additional
163
+ attribution notices cannot be construed as modifying the License.
164
+
165
+ You may add Your own copyright statement to Your modifications and may
166
+ provide additional or different license terms and conditions for use,
167
+ reproduction, or distribution of Your modifications, or for any such
168
+ Derivative Works as a whole, provided Your use, reproduction, and
169
+ distribution of the Work otherwise complies with the conditions stated
170
+ in this License (including the Commons Clause License Condition).
171
+
172
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
173
+ any Contribution intentionally submitted for inclusion in the Work by
174
+ You to the Licensor shall be under the terms and conditions of this
175
+ License, without any additional terms or conditions. Notwithstanding
176
+ the above, nothing herein shall supersede or modify the terms of any
177
+ separate license agreement you may have executed with Licensor
178
+ regarding such Contributions.
179
+
180
+ 6. Trademarks. This License does not grant permission to use the trade
181
+ names, trademarks, service marks, or product names of the Licensor,
182
+ except as required for reasonable and customary use in describing the
183
+ origin of the Work and reproducing the content of the NOTICE file.
184
+
185
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed
186
+ to in writing, Licensor provides the Work (and each Contributor
187
+ provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR
188
+ CONDITIONS OF ANY KIND, either express or implied, including, without
189
+ limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
190
+ MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
191
+ responsible for determining the appropriateness of using or
192
+ redistributing the Work and assume any risks associated with Your
193
+ exercise of permissions under this License.
194
+
195
+ 8. Limitation of Liability. In no event and under no legal theory,
196
+ whether in tort (including negligence), contract, or otherwise, unless
197
+ required by applicable law (such as deliberate and grossly negligent
198
+ acts) or agreed to in writing, shall any Contributor be liable to You
199
+ for damages, including any direct, indirect, special, incidental, or
200
+ consequential damages of any character arising as a result of this
201
+ License or out of the use or inability to use the Work (including but
202
+ not limited to damages for loss of goodwill, work stoppage, computer
203
+ failure or malfunction, or any and all other commercial damages or
204
+ losses), even if such Contributor has been advised of the possibility
205
+ of such damages.
206
+
207
+ 9. Accepting Warranty or Additional Liability. While redistributing
208
+ the Work or Derivative Works thereof, You may choose to offer, and
209
+ charge a fee for, acceptance of support, warranty, indemnity, or other
210
+ liability obligations and/or rights consistent with this License
211
+ (including the Commons Clause License Condition). However, in
212
+ accepting such obligations, You may act only on Your own behalf and on
213
+ Your sole responsibility, not on behalf of any other Contributor, and
214
+ only if You agree to indemnify, defend, and hold each Contributor
215
+ harmless for any liability incurred by, or claims asserted against,
216
+ such Contributor by reason of your accepting any such warranty or
217
+ additional liability.
218
+
219
+ END OF TERMS AND CONDITIONS
220
+
221
+ Copyright 2026 Alexander März
222
+
223
+ Licensed under the Apache License, Version 2.0, with Commons Clause
224
+ License Condition v1.0 (the "License"); you may not use this file
225
+ except in compliance with the License. You may obtain a copy of the
226
+ License at
227
+
228
+ http://www.apache.org/licenses/LICENSE-2.0
229
+
230
+ Unless required by applicable law or agreed to in writing, software
231
+ distributed under the License is distributed on an "AS IS" BASIS,
232
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
233
+ implied. See the License for the specific language governing
234
+ permissions and limitations under the License.
235
+ Project-URL: Repository, https://github.com/StatMixedML/Hyper-Trees
236
+ Project-URL: Issues, https://github.com/StatMixedML/Hyper-Trees/issues
237
+ Project-URL: Discussions, https://github.com/StatMixedML/Hyper-Trees/discussions
238
+ Project-URL: Documentation, https://github.com/StatMixedML/Hyper-Trees#readme
239
+ Keywords: Gradient Boosted Trees,Hyper Models,Hybrid Models,Machine Learning,Time Series Forecasting,Time-Varying Parameters
240
+ Classifier: Development Status :: 3 - Alpha
241
+ Classifier: Intended Audience :: Science/Research
242
+ Classifier: Intended Audience :: Developers
243
+ Classifier: License :: Other/Proprietary License
244
+ Classifier: Programming Language :: Python :: 3
245
+ Classifier: Programming Language :: Python :: 3.11
246
+ Classifier: Programming Language :: Python :: 3.12
247
+ Classifier: Operating System :: OS Independent
248
+ Requires-Python: <3.13,>=3.11
249
+ Description-Content-Type: text/markdown
250
+ License-File: LICENSE
251
+ Requires-Dist: lightgbm>=4.6
252
+ Requires-Dist: numpy>=2.0
253
+ Requires-Dist: pandas>=2.3
254
+ Requires-Dist: torch<2.10,>=2
255
+ Provides-Extra: extras
256
+ Requires-Dist: matplotlib>=3.10; extra == "extras"
257
+ Requires-Dist: shap<0.51,>=0.48; extra == "extras"
258
+ Requires-Dist: optuna>=4; extra == "extras"
259
+ Provides-Extra: docs
260
+ Requires-Dist: mkdocs; extra == "docs"
261
+ Requires-Dist: mkdocstrings[python]; extra == "docs"
262
+ Requires-Dist: mkdocs-jupyter; extra == "docs"
263
+ Requires-Dist: mkdocs-material; extra == "docs"
264
+ Provides-Extra: test
265
+ Requires-Dist: pytest; extra == "test"
266
+ Requires-Dist: pytest-cov; extra == "test"
267
+ Requires-Dist: pytest-mock; extra == "test"
268
+ Requires-Dist: coverage; extra == "test"
269
+ Requires-Dist: flake8; extra == "test"
270
+ Provides-Extra: dev
271
+ Requires-Dist: hypertrees-forecasting[test]; extra == "dev"
272
+ Requires-Dist: black; extra == "dev"
273
+ Requires-Dist: isort; extra == "dev"
274
+ Requires-Dist: mypy; extra == "dev"
275
+ Requires-Dist: pre-commit; extra == "dev"
276
+ Dynamic: license-file
277
+
278
+ <h4 align="center">
279
+
280
+ | | **[Release Notes](https://github.com/StatMixedML/Hyper-Trees/releases)** |
281
+ |----------------------|---|
282
+ | **Open&#160;Source** | [![License: Apache 2.0 + Commons Clause](https://img.shields.io/badge/License-Apache_2.0_with_Commons_Clause-yellow.svg)](LICENSE) |
283
+ | **CI/CD** | [![github-actions](https://img.shields.io/github/actions/workflow/status/StatMixedML/Hyper-Trees/unit-tests.yml?logo=github)](https://github.com/StatMixedML/Hyper-Trees/actions/workflows/unit-tests.yml) |
284
+ | **Code** | [![!python-versions](https://img.shields.io/pypi/pyversions/hypertrees-forecasting)](https://www.python.org/) <img src="https://codecov.io/gh/StatMixedML/Hyper-Trees/branch/main/graph/badge.svg" alt="Code coverage status badge"> |
285
+ | **Downloads** | ![Pepy Total Downloads](https://img.shields.io/pepy/dt/hypertrees-forecasting?label=PyPI%20Downloads&color=green) |
286
+ | **Paper** | [![Arxiv link](https://img.shields.io/badge/arXiv-Forecasting%20with%20Hyper--Trees-color=brightgreen)](https://arxiv.org/pdf/2405.07836) |
287
+
288
+ </h4>
289
+
290
+ ---
291
+ # Overview
292
+
293
+ Hyper-Trees are a novel framework for modeling time series data with gradient boosted trees (GBDTs). Instead of forecasting time series directly, Hyper-Trees use GBDTs to learn the parameters of a classical time series model such as ARIMA or Exponential Smoothing as functions of features. The target time series model then generates the final forecasts. This naturally injects the inductive bias of forecasting models into tree-based learning.
294
+ While our framework is built upon the well-established LightGBM model, it can in principle be used with any modern GBDT framework.
295
+
296
+
297
+
298
+ <div align="center">
299
+ <img src="hypertrees/hyper_treenet.png" width="70%" alt="Hyper-Tree architecture">
300
+ </div>
301
+
302
+ Hyper-Trees offer several advantages:
303
+
304
+ - **Improved Extrapolation in Tree-Based Models.** Forecasts are generated via a parametric target time series model, rather than the piece-wise constant output of tree-models.
305
+ - **Cross-Series Learning with Local Adaptivity.** A global GBDT learns the feature-to-parameter mapping, so similar series share information while each still receives its own parameters.
306
+ - **Time-Varying Parameters.** Coefficients vary cross-sectionally (series-specific features such as store type or region) and temporally (day, week, month, year, ...), capturing effects such as distinct AR(p) dynamics on weekdays versus weekends.
307
+ - **Model Transparency and Interpretability.** Forecasts are produced by classical time series models whose parameters retain clear statistical meaning.
308
+ - **Full Functionality of GBDTs.** Core GBDT capabilities (missing-value handling, feature importance, categorical support, monotonicity constraints) carry over unchanged.
309
+
310
+ ---
311
+
312
+ # News
313
+ [2024-05-01] Create repository and initial commits.
314
+
315
+ ---
316
+
317
+ ## Available Models
318
+
319
+ | Model | Description | Scope |
320
+ | :--- | :--- | :---: |
321
+ | **`Hyper-Tree-AR`** | Autoregressive model with tree-learned, time-varying AR(p) parameters. | ![](https://img.shields.io/badge/Global-blue) ![](https://img.shields.io/badge/Local-green) |
322
+ | **`Hyper-TreeNet-AR`** | Hybrid model combining tree embeddings with a neural network to learn AR(p) parameters. | ![](https://img.shields.io/badge/Global-blue) ![](https://img.shields.io/badge/Local-green) |
323
+ | **`Hyper-Tree-ETS`** | Exponential smoothing model where ETS parameters are estimated by trees. | ![](https://img.shields.io/badge/Global-blue) ![](https://img.shields.io/badge/Local-green) |
324
+ | **`Hyper-Tree-STL`** | STL decomposition with tree-learned parameters for trend and seasonality. | ![](https://img.shields.io/badge/Local-green) |
325
+
326
+ `Global` means a single model is trained across multiple time series; `Local` means a separate model is trained for each individual series.
327
+ All models currently provide point forecasts only. Probabilistic forecasting is planned for future releases. Note on `Hyper-Tree-STL`: it is designed to decompose time series into trend and seasonal components and is not intended for forecasting. However, the STL-parameters can still be used to generate forecasts.
328
+
329
+ # Getting Started
330
+
331
+ We refer to the `examples/` notebooks for quick-start guides on using the Hyper-Tree models.
332
+
333
+ ---
334
+
335
+
336
+
337
+ # Installation
338
+
339
+ To run the `Hyper-TreeNet-AR` model efficiently, we recommend installing PyTorch with CUDA support. While GPU is recommended for faster runtime, it is not strictly required. All models also run on CPU. We use `uv pip` for installs. If you don't have `uv`, consider installing it or simply replace `uv pip install` with `pip install`.
340
+
341
+ ### Basic Installation (CPU)
342
+
343
+ Install the latest release from PyPI:
344
+
345
+ ```bash
346
+ uv pip install hypertrees-forecasting
347
+ ```
348
+
349
+ Or install the development version directly from GitHub:
350
+
351
+ ```bash
352
+ uv pip install git+https://github.com/StatMixedML/Hyper-Trees.git
353
+ ```
354
+
355
+ Or clone the repository and install in editable mode for development:
356
+
357
+ ```bash
358
+ git clone https://github.com/StatMixedML/Hyper-Trees.git
359
+ cd Hyper-Trees
360
+ uv pip install -e .
361
+ ```
362
+
363
+ This installs Hyper-Trees with the latest compatible versions of all dependencies, including a CPU-compatible version of PyTorch. All models will work, just without GPU acceleration.
364
+
365
+ ### Optional: Extra Dependencies
366
+
367
+ The example notebooks under `examples/` use `matplotlib` (plotting), `shap` (feature-importance visualization), and `optuna` (hyper-parameter optimization). To install these alongside the package, use the `extras` option:
368
+
369
+ ```bash
370
+ uv pip install "hypertrees-forecasting[extras]" # from PyPI
371
+ uv pip install -e ".[extras]" # editable / development
372
+ ```
373
+
374
+ These packages are not required to use the Hyper-Tree models themselves, only to run the example notebooks.
375
+
376
+ ### GPU Support
377
+
378
+ For CUDA-enabled PyTorch, install Hyper-Trees first, then install PyTorch from its CUDA index:
379
+
380
+ ```bash
381
+ uv pip install torch --index-url https://download.pytorch.org/whl/cu121 --upgrade
382
+ ```
383
+
384
+ Replace `cu121` with the variant matching your driver. See [pytorch.org/get-started/locally](https://pytorch.org/get-started/locally/) for the current list.
385
+
386
+ # Reproducing Paper Results
387
+
388
+ The full reproducibility package, including the pinned environment, datasets, configurations, and experiment notebooks needed to reproduce all paper results, lives in the [`experiments/`](experiments/) folder. See the [Experiments README](experiments/README.md) for installation instructions and step-by-step guidance on running the experiments.
389
+
390
+ ---
391
+
392
+ # Early-stage software
393
+ `hypertrees-forecasting` is in an early stage of development and is provided *“as is”*, without any warranty or guarantee. We welcome bug reports, feature requests, and pull requests, and encourage feedback by opening a [new discussion](https://github.com/StatMixedML/Hyper-Trees/discussions). We strongly recommend thorough testing and validation before using the package in production or other critical applications.
394
+
395
+ ---
396
+
397
+ # Acknowledgments
398
+
399
+ This work draws on and integrates methods and implementations from the following key repositories:
400
+
401
+ - [**<u>LightGBM</u>**](https://github.com/microsoft/LightGBM) – Gradient boosting framework for efficient tree-based learning.
402
+ - [**<u>PyTorch</u>**](https://github.com/pytorch/pytorch) – Deep learning framework for tensor computation and neural network modeling.
403
+ - [**<u>Nixtla</u>**](https://github.com/Nixtla) – Open Source Time Series Ecosystem.
404
+ - [**<u>sktime</u>**](https://github.com/sktime/sktime) – A unified framework for machine learning with time series.
405
+ - [**<u>GluonTS</u>**](https://github.com/awslabs/gluonts) – Probabilistic time series modeling and forecasting with deep learning.
406
+ ---
407
+
408
+ ## License
409
+
410
+ This project is licensed under the Apache License 2.0 with Commons Clause License Condition v1.0. In short, the code is free for research, academic, testing, production, and internal commercial use; selling access to the Software's functionality as a primary offering (e.g., as an API service, managed service, or hosted offering) requires a separate commercial license. See the [LICENSE](LICENSE) file for details.
411
+
412
+ ---
413
+
414
+ ## Citation
415
+
416
+ If you use `Hyper-Trees` in your research, please cite our paper:
417
+
418
+ [![Arxiv link](https://img.shields.io/badge/arXiv-Forecasting%20with%20Hyper--Trees-color=brightgreen)](https://arxiv.org/pdf/2405.07836) <br/>
419
+
420
+ ```bibtex
421
+ @article{maerz2024hypertrees,
422
+ title = {Forecasting with Hyper-Trees},
423
+ author = {März, Alexander and Rasul, Kashif},
424
+ journal = {arXiv preprint arXiv:2405.07836},
425
+ year = {2024}
426
+ }
427
+ ```