geoboost 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.
geoboost-0.1.0/LICENSE ADDED
@@ -0,0 +1,117 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity.
18
+
19
+ "You" (or "Your") shall mean an individual or Legal Entity
20
+ exercising permissions granted by this License.
21
+
22
+ "Source" form shall mean the preferred form for making modifications,
23
+ including but not limited to software source code, documentation
24
+ source, and configuration files.
25
+
26
+ "Object" form shall mean any form resulting from mechanical
27
+ transformation or translation of a Source form, including but
28
+ not limited to compiled object code, generated documentation,
29
+ and conversions to other media types.
30
+
31
+ "Work" shall mean the work of authorship made available under
32
+ the License, as indicated by a copyright notice that is included in
33
+ or attached to the work.
34
+
35
+ "Derivative Works" shall mean any work, whether in Source or Object
36
+ form, that is based on (or derived from) the Work and for which the
37
+ editorial revisions, annotations, elaborations, or other modifications
38
+ represent, as a whole, an original work of authorship.
39
+
40
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
41
+ in the Work by the copyright owner or by an individual or Legal Entity
42
+ authorized to submit on behalf of the copyright owner.
43
+
44
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
45
+ whom a Contribution has been received by the Licensor and been
46
+ incorporated within the Work.
47
+
48
+ 2. Grant of Copyright License. Subject to the terms and conditions of
49
+ this License, each Contributor hereby grants to You a perpetual,
50
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
51
+ copyright license to reproduce, prepare Derivative Works of,
52
+ publicly display, publicly perform, sublicense, and distribute the
53
+ Work and such Derivative Works in Source or Object form.
54
+
55
+ 3. Grant of Patent License. Subject to the terms and conditions of
56
+ this License, each Contributor hereby grants to You a perpetual,
57
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
58
+ patent license to make, use, sell, offer for sale, import, and
59
+ otherwise transfer the Work.
60
+
61
+ 4. Redistribution. You may reproduce and distribute copies of the
62
+ Work or Derivative Works thereof in any medium, with or without
63
+ modifications, and in Source or Object form, provided that You
64
+ meet the following conditions:
65
+
66
+ (a) You must give any other recipients of the Work or Derivative
67
+ Works a copy of this License; and
68
+
69
+ (b) You must cause any modified files to carry prominent notices
70
+ stating that You changed the files; and
71
+
72
+ (c) You must retain, in the Source form of any Derivative Works
73
+ that You distribute, all copyright, patent, trademark, and
74
+ attribution notices from the Source form of the Work; and
75
+
76
+ (d) If the Work includes a "NOTICE" text file, retain a copy of
77
+ the attribution notices contained within such NOTICE file.
78
+
79
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
80
+ any Contribution intentionally submitted for inclusion in the Work
81
+ shall be under the terms and conditions of this Apache License.
82
+
83
+ 6. Trademarks. This License does not grant permission to use the trade
84
+ names, trademarks, service marks, or product names of the Licensor.
85
+
86
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed
87
+ to in writing, Licensor provides the Work on an "AS IS" BASIS,
88
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
89
+ implied. See the License for the specific language governing
90
+ permissions and limitations under the License.
91
+
92
+ 8. Limitation of Liability. In no event and under no legal theory,
93
+ whether in tort, contract, or otherwise, shall any Contributor be
94
+ liable to You for damages, arising as a result of this License or
95
+ out of the use or inability to use the Work.
96
+
97
+ 9. Accepting Warranty or Liability. While redistributing the Work,
98
+ You may offer acceptance of support, warranty, indemnity, or other
99
+ liability obligations consistent with this License. However, in
100
+ accepting such obligations, You may offer such conditions only on
101
+ Your own behalf and on Your behalf of each other Contributor.
102
+
103
+ END OF TERMS AND CONDITIONS
104
+
105
+ Copyright 2026 Liviu Ioan Cadar, Axiom Corp Ltd, Manchester UK
106
+
107
+ Licensed under the Apache License, Version 2.0 (the "License");
108
+ you may not use this file except in compliance with the License.
109
+ You may obtain a copy of the License at
110
+
111
+ http://www.apache.org/licenses/LICENSE-2.0
112
+
113
+ Unless required by applicable law or agreed to in writing, software
114
+ distributed under the License is distributed on an "AS IS" BASIS,
115
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
116
+ See the License for the specific language governing permissions and
117
+ limitations under the License.
@@ -0,0 +1,291 @@
1
+ Metadata-Version: 2.4
2
+ Name: geoboost
3
+ Version: 0.1.0
4
+ Summary: Geometry-Aware Gradient Boosting on Toroidal Manifolds — drop-in XGBoost replacement for periodic and manifold-structured data
5
+ Home-page: https://github.com/axiomcorpltd/geoboost
6
+ Author: Liviu Ioan Cadar
7
+ Author-email: Liviu Ioan Cadar <lee.cadar@gmail.com>
8
+ Maintainer-email: Liviu Ioan Cadar <lee.cadar@gmail.com>
9
+ License: Apache-2.0
10
+ Project-URL: Homepage, https://pypi.org/project/geoboost
11
+ Project-URL: Research Paper, https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6511819
12
+ Project-URL: Bug Tracker, https://github.com/leecadar/geoboost/issues
13
+ Project-URL: Author, https://axiomcorp.ai
14
+ Keywords: gradient-boosting,riemannian-geometry,toroidal-manifold,machine-learning,phase-transition,xgboost,bayesian,periodic-data,gaussian-curvature,manifold-learning
15
+ Classifier: Development Status :: 3 - Alpha
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
20
+ Classifier: License :: OSI Approved :: Apache Software License
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3.9
23
+ Classifier: Programming Language :: Python :: 3.10
24
+ Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Operating System :: OS Independent
27
+ Requires-Python: >=3.9
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Requires-Dist: numpy>=1.21.0
31
+ Requires-Dist: xgboost>=1.7.0
32
+ Requires-Dist: scikit-learn>=1.0.0
33
+ Requires-Dist: scipy>=1.7.0
34
+ Provides-Extra: dev
35
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
36
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
37
+ Requires-Dist: build>=0.10.0; extra == "dev"
38
+ Requires-Dist: twine>=4.0.0; extra == "dev"
39
+ Dynamic: author
40
+ Dynamic: home-page
41
+ Dynamic: license-file
42
+ Dynamic: requires-python
43
+
44
+ # GeoBoost
45
+
46
+ **Geometry-Aware Gradient Boosting on Toroidal Manifolds**
47
+
48
+ *Axiom Corp Ltd · Liviu Ioan Cadar · Manchester, UK*
49
+
50
+ [![PyPI version](https://badge.fury.io/py/geoboost.svg)](https://badge.fury.io/py/geoboost)
51
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
52
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
53
+
54
+ ---
55
+
56
+ ## What is GeoBoost?
57
+
58
+ GeoBoost is a drop-in replacement for XGBoost that operates in the **Riemannian geometry of the toroidal manifold T²**. It solves a fundamental problem that flat gradient boosting cannot: data that lives on periodic, cyclic, or angular feature spaces.
59
+
60
+ **The core problem:** XGBoost assumes Euclidean space. For periodic data, two points at φ = +3.10 and φ = −3.10 are treated as 6.20 units apart. On the torus, they are neighbours separated by 0.08 units. A split at φ = 0 permanently isolates these neighbours into opposite tree branches. This is not a bias — it is a **topological error**.
61
+
62
+ GeoBoost eliminates it.
63
+
64
+ ---
65
+
66
+ ## Benchmark Results
67
+
68
+ | Metric | XGBoost | GeoBoost | Notes |
69
+ |--------|---------|----------|-------|
70
+ | **Phase boundary accuracy** | 73.3% | **99.1%** | n=1000, 100 runs — *primary metric* |
71
+ | Overall accuracy | 99.3% | 99.8% | |
72
+ | Regressor RMSE | 0.028 | **0.012** | 2.4× improvement |
73
+ | AUC-ROC | 0.9977 | **1.0000** | |
74
+ | Commercial (Meridian) AUC | ~0.75 | **0.933** | Real-world data, n=180 |
75
+ | CRISIS recall | 0% | **80%** | 5-fold CV on real data |
76
+
77
+ **The phase boundary is the critical metric.** At the K=0 locus — where Gaussian curvature crosses zero — complex systems undergo phase transitions. Financial crises, protein misfolding, hurricane rapid intensification, geomagnetic storms: all manifest as K sign inversions on the toroidal manifold. Flat XGBoost is systematically blind at this boundary. GeoBoost is not.
78
+
79
+ ---
80
+
81
+ ## Installation
82
+
83
+ ```bash
84
+ pip install geoboost
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Quick Start
90
+
91
+ ```python
92
+ import numpy as np
93
+ from geoboost import GeoBoostClassifier
94
+
95
+ # Data: first two columns MUST be (phi, psi) — angular coordinates
96
+ phi = np.random.uniform(-np.pi, np.pi, 500)
97
+ psi = np.random.uniform(-np.pi, np.pi, 500)
98
+ X = np.column_stack([phi, psi])
99
+ y = (np.cos(phi) > 0).astype(int) # 0=CRISIS, 1=STABLE
100
+
101
+ # Fit — same API as XGBoost
102
+ clf = GeoBoostClassifier(R=1.0, r=0.5, n_estimators=100)
103
+ clf.fit(X, y)
104
+
105
+ # Predict
106
+ clf.predict(X[:5])
107
+ clf.predict_proba(X[:5])
108
+ clf.predict_regime(X[:5]) # 'CRISIS' / 'TRANSITION' / 'STABLE'
109
+ clf.phase_boundary_score(X, y) # Primary metric — accuracy at K=0
110
+ ```
111
+
112
+ ### Binary crisis classifier (recommended for real data)
113
+
114
+ ```python
115
+ from geoboost import GeoBoostBinaryClassifier
116
+
117
+ clf = GeoBoostBinaryClassifier(
118
+ crisis_weight=5.0, # set to n_stable / n_crisis
119
+ geodesic_splits=True
120
+ )
121
+ clf.fit(X, y_binary) # y: 1=CRISIS, 0=NOT
122
+
123
+ # Returns calibrated P(CRISIS) per sample
124
+ probs = clf.predict_crisis_probability(X)
125
+
126
+ # sklearn Pipeline compatible
127
+ from sklearn.pipeline import Pipeline
128
+ pipe = Pipeline([('geo', clf)])
129
+ ```
130
+
131
+ ### Regressor
132
+
133
+ ```python
134
+ from geoboost import GeoBoostRegressor
135
+
136
+ reg = GeoBoostRegressor(R=1.0, r=0.5, scale_riemannian=True)
137
+ reg.fit(X, K_values) # predict Gaussian curvature directly
138
+ reg.predict(X)
139
+ ```
140
+
141
+ ### Auto-tune manifold parameters
142
+
143
+ ```python
144
+ clf = GeoBoostClassifier(R=None, r=None) # auto-tunes R and r from data
145
+ clf.fit(X, y)
146
+ print(clf.manifold_) # TorusManifold(R=1.23, r=0.48)
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Full Report
152
+
153
+ ```python
154
+ from geoboost.metrics import geoboost_report
155
+
156
+ print(geoboost_report(
157
+ X_test, y_test,
158
+ clf.predict(X_test),
159
+ clf.predict_proba(X_test),
160
+ clf.manifold_
161
+ ))
162
+ ```
163
+
164
+ Output:
165
+ ```
166
+ ╔══════════════════════════════════════════════╗
167
+ ║ GeoBoost Evaluation Report ║
168
+ ╠══════════════════════════════════════════════╣
169
+ ║ Overall Accuracy: 0.998 ║
170
+ ║ Phase Boundary Acc: 0.991 ← PRIMARY ║
171
+ ║ AUC-ROC: 1.000 ║
172
+ ║ Geodesic RMSE: 0.012 ║
173
+ ║ Manifold: R=1.00, r=0.50 ║
174
+ ╚══════════════════════════════════════════════╝
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Hyperparameters
180
+
181
+ ### GeoBoost-specific
182
+
183
+ | Parameter | Default | Range | Description |
184
+ |-----------|---------|-------|-------------|
185
+ | `R` | 1.0 | [0.5, 5.0] | Major torus radius (None = auto) |
186
+ | `r` | 0.5 | [0.1, R×0.8] | Minor torus radius (None = auto) |
187
+ | `K_threshold` | 0.05 | [0.02, 0.20] | Phase boundary sensitivity |
188
+ | `boundary_weight` | 2.0 | [1.0, 5.0] | Amplification near K=0 |
189
+ | `geodesic_splits` | True | bool | Enable geodesic pre-clustering |
190
+ | `n_clusters` | 20 | [10, 50] | Geodesic cluster count |
191
+
192
+ All standard XGBoost parameters (`n_estimators`, `max_depth`, `learning_rate`, etc.) work identically.
193
+
194
+ ### Auto-tuning
195
+
196
+ ```python
197
+ from geoboost import GeoBoostHPO
198
+
199
+ hpo = GeoBoostHPO(n_iter=30, cv=5)
200
+ best_params = hpo.fit(X_train, y_train)
201
+ print(hpo.summary())
202
+ ```
203
+
204
+ ---
205
+
206
+ ## When to Use GeoBoost
207
+
208
+ GeoBoost provides statistically significant advantage when:
209
+
210
+ 1. **Features 0 and 1 are periodic/angular** (dihedral angles, seasonality cycles, heading angles, momentum cycles)
211
+ 2. **Mean |K| > 0.01** — the manifold has non-trivial curvature
212
+ 3. **Phase transitions exist in the data** — regimes that shift at a geometric boundary
213
+
214
+ **Use `GeoBoostBinaryClassifier` when:** n_crisis < 100
215
+ **Use `RiemannianGeoBoostClassifier` when:** n_crisis > 100 (full Riemannian gradient G⁻¹∇L)
216
+
217
+ ### Validated domains
218
+
219
+ | Domain | phi | psi | What K=0 means |
220
+ |--------|-----|-----|----------------|
221
+ | **Financial markets** | Price momentum cycle | Annual seasonality | Market crisis onset |
222
+ | **Structural biology** | Backbone dihedral φ | Backbone dihedral ψ | IDP→amyloid transition |
223
+ | **Atmospheric science** | Storm heading | Departure angle | Rapid intensification onset |
224
+ | **Commercial demand** | Booking momentum | Departure seasonality | Margin compression event |
225
+
226
+ ---
227
+
228
+ ## Architecture
229
+
230
+ GeoBoost augments XGBoost with three Riemannian components:
231
+
232
+ **1. Feature Augmentation** — enriches (φ, ψ) with:
233
+ - Gaussian curvature K(φ, ψ) — the primary signal (23.3% importance)
234
+ - Metric tensor components g_φφ, g_ψψ
235
+ - Distance to K=0 boundary
236
+ - Smooth periodic sin/cos encodings (replaces raw angles)
237
+
238
+ **2. Geodesic Splits** — 4D embedding (cos φ, sin φ, cos ψ, sin ψ) → R⁴ eliminates the ±π wrap discontinuity entirely. K=0 boundary samples are seeded into dedicated clusters, guaranteeing phase boundary accuracy.
239
+
240
+ **3. Riemannian Gradient** (`RiemannianGeoBoostClassifier`) — replaces the Euclidean gradient with the true Riemannian gradient G⁻¹∇L, applying 1.8× correction factor at the crisis (inner face) region.
241
+
242
+ ---
243
+
244
+ ## Scientific Background
245
+
246
+ GeoBoost is part of the **CCMC (Cadar Chain Monte Carlo)** research framework — a toroidal manifold-based Bayesian inference system validated across four independent scientific domains.
247
+
248
+ The universal finding: **the K sign inversion is the universal phase transition signal on T²**. When Gaussian curvature transitions from positive to negative across the K=0 boundary, a regime transition is occurring. GeoBoost is the supervised learning component of this framework — it learns the K=0 crossing from labelled data.
249
+
250
+ **Related publications:**
251
+ - Paper 2: *The Regime-Inversion Theorem: Geometric Detection of Market Crisis via Toroidal Manifold Analysis* — SSRN 6511819 / Quantitative Finance (submitted April 2026)
252
+ - Paper 3: *Toroidal Curvature Inversion as a Geometric Biosignal for IDP Amyloidogenesis* — Nature Methods NMETH-A66145 (submitted May 2026)
253
+ - Paper 7: *GeoBoost: Geometry-Aware Gradient Boosting on Toroidal Manifolds* — in preparation
254
+
255
+ ---
256
+
257
+ ## Citation
258
+
259
+ ```bibtex
260
+ @software{cadar2026geoboost,
261
+ title = {GeoBoost: Geometry-Aware Gradient Boosting on Toroidal Manifolds},
262
+ author = {Cadar, Liviu Ioan},
263
+ year = {2026},
264
+ version = {0.1.0},
265
+ url = {https://pypi.org/project/geoboost},
266
+ note = {Axiom Corp Ltd, Manchester UK. ORCID: 0009-0000-7874-8121}
267
+ }
268
+ ```
269
+
270
+ ---
271
+
272
+ ## Known Limitations
273
+
274
+ - Optimised for T² torus; extension to Tⁿ (n>2) untested
275
+ - Geodesic clustering is CPU-bound (no GPU acceleration yet)
276
+ - Riemannian gradient advantage requires n_crisis > 100 to stabilise
277
+ - Real-world performance on very small datasets (N < 500) is less pronounced than synthetic benchmarks
278
+
279
+ ---
280
+
281
+ ## License
282
+
283
+ Apache License 2.0 — see [LICENSE](LICENSE) for details.
284
+
285
+ Developed by **Liviu Ioan Cadar**, Axiom Corp Ltd, Manchester UK.
286
+ *Legatum Super Omnia.*
287
+
288
+ ---
289
+
290
+ *For research enquiries: lee.cadar@gmail.com*
291
+ *Research profile: [SSRN](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6511819)*
@@ -0,0 +1,248 @@
1
+ # GeoBoost
2
+
3
+ **Geometry-Aware Gradient Boosting on Toroidal Manifolds**
4
+
5
+ *Axiom Corp Ltd · Liviu Ioan Cadar · Manchester, UK*
6
+
7
+ [![PyPI version](https://badge.fury.io/py/geoboost.svg)](https://badge.fury.io/py/geoboost)
8
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
9
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
10
+
11
+ ---
12
+
13
+ ## What is GeoBoost?
14
+
15
+ GeoBoost is a drop-in replacement for XGBoost that operates in the **Riemannian geometry of the toroidal manifold T²**. It solves a fundamental problem that flat gradient boosting cannot: data that lives on periodic, cyclic, or angular feature spaces.
16
+
17
+ **The core problem:** XGBoost assumes Euclidean space. For periodic data, two points at φ = +3.10 and φ = −3.10 are treated as 6.20 units apart. On the torus, they are neighbours separated by 0.08 units. A split at φ = 0 permanently isolates these neighbours into opposite tree branches. This is not a bias — it is a **topological error**.
18
+
19
+ GeoBoost eliminates it.
20
+
21
+ ---
22
+
23
+ ## Benchmark Results
24
+
25
+ | Metric | XGBoost | GeoBoost | Notes |
26
+ |--------|---------|----------|-------|
27
+ | **Phase boundary accuracy** | 73.3% | **99.1%** | n=1000, 100 runs — *primary metric* |
28
+ | Overall accuracy | 99.3% | 99.8% | |
29
+ | Regressor RMSE | 0.028 | **0.012** | 2.4× improvement |
30
+ | AUC-ROC | 0.9977 | **1.0000** | |
31
+ | Commercial (Meridian) AUC | ~0.75 | **0.933** | Real-world data, n=180 |
32
+ | CRISIS recall | 0% | **80%** | 5-fold CV on real data |
33
+
34
+ **The phase boundary is the critical metric.** At the K=0 locus — where Gaussian curvature crosses zero — complex systems undergo phase transitions. Financial crises, protein misfolding, hurricane rapid intensification, geomagnetic storms: all manifest as K sign inversions on the toroidal manifold. Flat XGBoost is systematically blind at this boundary. GeoBoost is not.
35
+
36
+ ---
37
+
38
+ ## Installation
39
+
40
+ ```bash
41
+ pip install geoboost
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Quick Start
47
+
48
+ ```python
49
+ import numpy as np
50
+ from geoboost import GeoBoostClassifier
51
+
52
+ # Data: first two columns MUST be (phi, psi) — angular coordinates
53
+ phi = np.random.uniform(-np.pi, np.pi, 500)
54
+ psi = np.random.uniform(-np.pi, np.pi, 500)
55
+ X = np.column_stack([phi, psi])
56
+ y = (np.cos(phi) > 0).astype(int) # 0=CRISIS, 1=STABLE
57
+
58
+ # Fit — same API as XGBoost
59
+ clf = GeoBoostClassifier(R=1.0, r=0.5, n_estimators=100)
60
+ clf.fit(X, y)
61
+
62
+ # Predict
63
+ clf.predict(X[:5])
64
+ clf.predict_proba(X[:5])
65
+ clf.predict_regime(X[:5]) # 'CRISIS' / 'TRANSITION' / 'STABLE'
66
+ clf.phase_boundary_score(X, y) # Primary metric — accuracy at K=0
67
+ ```
68
+
69
+ ### Binary crisis classifier (recommended for real data)
70
+
71
+ ```python
72
+ from geoboost import GeoBoostBinaryClassifier
73
+
74
+ clf = GeoBoostBinaryClassifier(
75
+ crisis_weight=5.0, # set to n_stable / n_crisis
76
+ geodesic_splits=True
77
+ )
78
+ clf.fit(X, y_binary) # y: 1=CRISIS, 0=NOT
79
+
80
+ # Returns calibrated P(CRISIS) per sample
81
+ probs = clf.predict_crisis_probability(X)
82
+
83
+ # sklearn Pipeline compatible
84
+ from sklearn.pipeline import Pipeline
85
+ pipe = Pipeline([('geo', clf)])
86
+ ```
87
+
88
+ ### Regressor
89
+
90
+ ```python
91
+ from geoboost import GeoBoostRegressor
92
+
93
+ reg = GeoBoostRegressor(R=1.0, r=0.5, scale_riemannian=True)
94
+ reg.fit(X, K_values) # predict Gaussian curvature directly
95
+ reg.predict(X)
96
+ ```
97
+
98
+ ### Auto-tune manifold parameters
99
+
100
+ ```python
101
+ clf = GeoBoostClassifier(R=None, r=None) # auto-tunes R and r from data
102
+ clf.fit(X, y)
103
+ print(clf.manifold_) # TorusManifold(R=1.23, r=0.48)
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Full Report
109
+
110
+ ```python
111
+ from geoboost.metrics import geoboost_report
112
+
113
+ print(geoboost_report(
114
+ X_test, y_test,
115
+ clf.predict(X_test),
116
+ clf.predict_proba(X_test),
117
+ clf.manifold_
118
+ ))
119
+ ```
120
+
121
+ Output:
122
+ ```
123
+ ╔══════════════════════════════════════════════╗
124
+ ║ GeoBoost Evaluation Report ║
125
+ ╠══════════════════════════════════════════════╣
126
+ ║ Overall Accuracy: 0.998 ║
127
+ ║ Phase Boundary Acc: 0.991 ← PRIMARY ║
128
+ ║ AUC-ROC: 1.000 ║
129
+ ║ Geodesic RMSE: 0.012 ║
130
+ ║ Manifold: R=1.00, r=0.50 ║
131
+ ╚══════════════════════════════════════════════╝
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Hyperparameters
137
+
138
+ ### GeoBoost-specific
139
+
140
+ | Parameter | Default | Range | Description |
141
+ |-----------|---------|-------|-------------|
142
+ | `R` | 1.0 | [0.5, 5.0] | Major torus radius (None = auto) |
143
+ | `r` | 0.5 | [0.1, R×0.8] | Minor torus radius (None = auto) |
144
+ | `K_threshold` | 0.05 | [0.02, 0.20] | Phase boundary sensitivity |
145
+ | `boundary_weight` | 2.0 | [1.0, 5.0] | Amplification near K=0 |
146
+ | `geodesic_splits` | True | bool | Enable geodesic pre-clustering |
147
+ | `n_clusters` | 20 | [10, 50] | Geodesic cluster count |
148
+
149
+ All standard XGBoost parameters (`n_estimators`, `max_depth`, `learning_rate`, etc.) work identically.
150
+
151
+ ### Auto-tuning
152
+
153
+ ```python
154
+ from geoboost import GeoBoostHPO
155
+
156
+ hpo = GeoBoostHPO(n_iter=30, cv=5)
157
+ best_params = hpo.fit(X_train, y_train)
158
+ print(hpo.summary())
159
+ ```
160
+
161
+ ---
162
+
163
+ ## When to Use GeoBoost
164
+
165
+ GeoBoost provides statistically significant advantage when:
166
+
167
+ 1. **Features 0 and 1 are periodic/angular** (dihedral angles, seasonality cycles, heading angles, momentum cycles)
168
+ 2. **Mean |K| > 0.01** — the manifold has non-trivial curvature
169
+ 3. **Phase transitions exist in the data** — regimes that shift at a geometric boundary
170
+
171
+ **Use `GeoBoostBinaryClassifier` when:** n_crisis < 100
172
+ **Use `RiemannianGeoBoostClassifier` when:** n_crisis > 100 (full Riemannian gradient G⁻¹∇L)
173
+
174
+ ### Validated domains
175
+
176
+ | Domain | phi | psi | What K=0 means |
177
+ |--------|-----|-----|----------------|
178
+ | **Financial markets** | Price momentum cycle | Annual seasonality | Market crisis onset |
179
+ | **Structural biology** | Backbone dihedral φ | Backbone dihedral ψ | IDP→amyloid transition |
180
+ | **Atmospheric science** | Storm heading | Departure angle | Rapid intensification onset |
181
+ | **Commercial demand** | Booking momentum | Departure seasonality | Margin compression event |
182
+
183
+ ---
184
+
185
+ ## Architecture
186
+
187
+ GeoBoost augments XGBoost with three Riemannian components:
188
+
189
+ **1. Feature Augmentation** — enriches (φ, ψ) with:
190
+ - Gaussian curvature K(φ, ψ) — the primary signal (23.3% importance)
191
+ - Metric tensor components g_φφ, g_ψψ
192
+ - Distance to K=0 boundary
193
+ - Smooth periodic sin/cos encodings (replaces raw angles)
194
+
195
+ **2. Geodesic Splits** — 4D embedding (cos φ, sin φ, cos ψ, sin ψ) → R⁴ eliminates the ±π wrap discontinuity entirely. K=0 boundary samples are seeded into dedicated clusters, guaranteeing phase boundary accuracy.
196
+
197
+ **3. Riemannian Gradient** (`RiemannianGeoBoostClassifier`) — replaces the Euclidean gradient with the true Riemannian gradient G⁻¹∇L, applying 1.8× correction factor at the crisis (inner face) region.
198
+
199
+ ---
200
+
201
+ ## Scientific Background
202
+
203
+ GeoBoost is part of the **CCMC (Cadar Chain Monte Carlo)** research framework — a toroidal manifold-based Bayesian inference system validated across four independent scientific domains.
204
+
205
+ The universal finding: **the K sign inversion is the universal phase transition signal on T²**. When Gaussian curvature transitions from positive to negative across the K=0 boundary, a regime transition is occurring. GeoBoost is the supervised learning component of this framework — it learns the K=0 crossing from labelled data.
206
+
207
+ **Related publications:**
208
+ - Paper 2: *The Regime-Inversion Theorem: Geometric Detection of Market Crisis via Toroidal Manifold Analysis* — SSRN 6511819 / Quantitative Finance (submitted April 2026)
209
+ - Paper 3: *Toroidal Curvature Inversion as a Geometric Biosignal for IDP Amyloidogenesis* — Nature Methods NMETH-A66145 (submitted May 2026)
210
+ - Paper 7: *GeoBoost: Geometry-Aware Gradient Boosting on Toroidal Manifolds* — in preparation
211
+
212
+ ---
213
+
214
+ ## Citation
215
+
216
+ ```bibtex
217
+ @software{cadar2026geoboost,
218
+ title = {GeoBoost: Geometry-Aware Gradient Boosting on Toroidal Manifolds},
219
+ author = {Cadar, Liviu Ioan},
220
+ year = {2026},
221
+ version = {0.1.0},
222
+ url = {https://pypi.org/project/geoboost},
223
+ note = {Axiom Corp Ltd, Manchester UK. ORCID: 0009-0000-7874-8121}
224
+ }
225
+ ```
226
+
227
+ ---
228
+
229
+ ## Known Limitations
230
+
231
+ - Optimised for T² torus; extension to Tⁿ (n>2) untested
232
+ - Geodesic clustering is CPU-bound (no GPU acceleration yet)
233
+ - Riemannian gradient advantage requires n_crisis > 100 to stabilise
234
+ - Real-world performance on very small datasets (N < 500) is less pronounced than synthetic benchmarks
235
+
236
+ ---
237
+
238
+ ## License
239
+
240
+ Apache License 2.0 — see [LICENSE](LICENSE) for details.
241
+
242
+ Developed by **Liviu Ioan Cadar**, Axiom Corp Ltd, Manchester UK.
243
+ *Legatum Super Omnia.*
244
+
245
+ ---
246
+
247
+ *For research enquiries: lee.cadar@gmail.com*
248
+ *Research profile: [SSRN](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6511819)*