sbasu2512 commited on
Commit
c01e005
Β·
1 Parent(s): 802f3c7

Initial commit

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ xgb_model.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,364 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ library_name: xgboost
4
+ tags:
5
+ - finance
6
+ - stock-market
7
+ - indian-stock-market
8
+ - nse
9
+ - bse
10
+ - tabular
11
+ - time-series
12
+ - xgboost
13
+ - classification
14
+ - indian-market
15
+ ---
16
+
17
+ # XGBoost β€” Indian Stock Market Prediction
18
+
19
+ XGBoost binary classification model trained on historical Indian equity-market data to predict whether a stock reaches a specified positive-return threshold within a **5-trading-day horizon**.
20
+
21
+ The current model targets a **+3.0% return threshold** and was trained across thousands of Indian equities using technical, market, cross-sectional, and macroeconomic features.
22
+
23
+ > **Research status:** This repository contains a research model and its out-of-sample evaluation artifacts. The reported results should not be interpreted as a guarantee of future market performance or profitability.
24
+
25
+ ---
26
+
27
+ ## Model Overview
28
+
29
+ | Property | Value |
30
+ | ----------------------- | ------------------------------------ |
31
+ | Model | XGBoost |
32
+ | Task | Binary classification |
33
+ | Prediction target | β‰₯ +3.0% return within 5 trading days |
34
+ | Dataset size | ~6.92 million rows |
35
+ | Symbols | 2,656 |
36
+ | Historical period | 2008-09-02 β†’ 2026-06-30 |
37
+ | Features | 221 |
38
+ | Positive class | 36.8% |
39
+ | Negative class | 63.2% |
40
+ | `scale_pos_weight` | 1.49 |
41
+ | Training method | Histogram-based XGBoost |
42
+ | Hardware | CUDA GPU |
43
+ | Maximum boosting rounds | 2,000 |
44
+ | Learning rate | 0.02 |
45
+ | Maximum tree depth | 6 |
46
+ | Early stopping | 75 rounds |
47
+
48
+ ---
49
+
50
+ # Dataset
51
+
52
+ The training dataset contains approximately **6.92 million observations** covering **2,656 Indian stock symbols** from September 2008 through June 2026.
53
+
54
+ The model uses 221 input features derived from historical market data and broader market conditions.
55
+
56
+ The feature groups include:
57
+
58
+ * Price returns
59
+ * Momentum
60
+ * Trend indicators
61
+ * Volatility
62
+ * Technical indicators
63
+ * Relative strength
64
+ * Market breadth
65
+ * Cross-sectional statistics
66
+ * Nifty relationships
67
+ * Gold relationships
68
+ * Brent crude relationships
69
+ * USD/INR relationships
70
+ * US-market indicators
71
+
72
+ The target is a binary label representing whether the specified positive-return threshold is reached within the prediction horizon.
73
+
74
+ ---
75
+
76
+ # Temporal Dataset Split
77
+
78
+ The dataset was divided chronologically rather than randomly.
79
+
80
+ | Split | Period | Approx. Share |
81
+ | ----------------- | ----------------------- | ------------: |
82
+ | Training | 2008-09-02 β†’ 2021-02-15 | 70% |
83
+ | Validation | 2021-02-16 β†’ 2024-08-30 | 20% |
84
+ | Walk-forward test | 2024-09-01 β†’ 2026-06-30 | 10% |
85
+
86
+ This temporal separation is intended to reduce leakage from randomly mixing observations from different points in time.
87
+
88
+ The final test period was not used for model fitting.
89
+
90
+ ---
91
+
92
+ # Validation Performance
93
+
94
+ The model achieved the following results on the held-out validation period:
95
+
96
+ **2021-02-16 β†’ 2024-08-30**
97
+
98
+ | Metric | Score |
99
+ | ---------------------------------- | ---------: |
100
+ | ROC-AUC | **0.9472** |
101
+ | PR-AUC | **0.9042** |
102
+ | Precision | **0.7981** |
103
+ | Recall | **0.8364** |
104
+ | Information Coefficient (Spearman) | **0.7140** |
105
+ | Brier Score | **0.0835** |
106
+ | Brier Skill Score | **0.6068** |
107
+ | Mean Calibration Error | **0.0749** |
108
+
109
+ Validation observations:
110
+
111
+ **1,698,058 rows**
112
+
113
+ The validation results indicate strong separation between the positive and negative classes on this historical period.
114
+
115
+ However, validation performance alone should not be treated as evidence of future profitability.
116
+
117
+ ---
118
+
119
+ # Validation Decile Analysis
120
+
121
+ Predictions were divided into ten probability-ranked groups.
122
+
123
+ | Decile | Hit Rate | Samples |
124
+ | -----: | -------: | ------: |
125
+ | D10 | 98.4% | 169,806 |
126
+ | D9 | 88.8% | 169,806 |
127
+ | D8 | 60.5% | 169,806 |
128
+ | D7 | 31.1% | 169,805 |
129
+ | D6 | 14.6% | 169,806 |
130
+ | D5 | 6.6% | 169,806 |
131
+ | D4 | 3.1% | 169,805 |
132
+ | D3 | 1.7% | 169,806 |
133
+ | D2 | 0.9% | 169,806 |
134
+ | D1 | 0.4% | 169,806 |
135
+
136
+ The probability ranking shows strong separation across the validation sample, with substantially different observed positive rates between the lowest- and highest-ranked groups.
137
+
138
+ These figures describe historical classification performance and do not account for transaction costs, slippage, liquidity constraints, portfolio construction, or market impact.
139
+
140
+ ---
141
+
142
+ # Out-of-Sample Walk-Forward Evaluation
143
+
144
+ The model was subsequently evaluated chronologically over the final portion of the dataset.
145
+
146
+ The test period was divided into four chronological folds of approximately six months each.
147
+
148
+ | Fold | Period | PR-AUC | IC | Brier | Samples |
149
+ | ---- | ----------------------- | ---------: | ---------: | -----: | ------: |
150
+ | 1 | 2024-09-01 β†’ 2025-02-28 | **0.9336** | **0.7619** | 0.0850 | 262,062 |
151
+ | 2 | 2025-03-01 β†’ 2025-08-31 | **0.8987** | **0.7044** | 0.0829 | 266,786 |
152
+ | 3 | 2025-09-01 β†’ 2026-02-28 | **0.8921** | **0.7011** | 0.0845 | 282,585 |
153
+ | 4 | 2026-03-01 β†’ 2026-06-30 | **0.8962** | **0.7157** | 0.0925 | 180,837 |
154
+
155
+ ### Walk-Forward Summary
156
+
157
+ | Statistic | Value |
158
+ | ---------------- | ---------: |
159
+ | Mean PR-AUC | **0.9052** |
160
+ | Mean IC | **0.7208** |
161
+ | Mean Brier Score | **0.0862** |
162
+ | Minimum IC | **0.7011** |
163
+ | Maximum IC | **0.7619** |
164
+
165
+ The model maintained relatively strong classification performance across all four chronological folds.
166
+
167
+ Performance did, however, vary between periods. The difference between the highest and lowest observed IC is approximately **0.061**.
168
+
169
+ This suggests that model performance is not completely invariant across market regimes and warrants additional robustness testing.
170
+
171
+ ---
172
+
173
+ # Overfitting & Generalization
174
+
175
+ The model was evaluated using a chronological validation set followed by a later out-of-sample test period.
176
+
177
+ The results provide evidence that the model retains predictive separation outside its training period.
178
+
179
+ However, the current experiment does **not** establish that the model is free from overfitting.
180
+
181
+ In particular:
182
+
183
+ * Validation performance is very strong.
184
+ * Walk-forward test performance remains strong.
185
+ * Performance varies between chronological folds.
186
+ * The model reached the maximum configured **2,000 boosting rounds**, with the best iteration at **1,999**.
187
+ * Early stopping therefore did not activate before the configured maximum number of rounds.
188
+
189
+ The last point means that additional experiments with a larger maximum number of boosting rounds should be evaluated carefully rather than assuming that more trees will improve generalization.
190
+
191
+ Future experiments should compare performance across additional temporal folds and assess whether increasing model complexity improves out-of-sample performance or simply improves the validation period.
192
+
193
+ ---
194
+
195
+ # Calibration
196
+
197
+ The validation set produced:
198
+
199
+ * Brier Score: **0.0835**
200
+ * Brier Skill Score: **0.6068**
201
+ * Mean Calibration Error: **0.0749**
202
+
203
+ The model therefore produces probability scores that contain useful information, but the raw probabilities should not automatically be interpreted as perfectly calibrated real-world probabilities.
204
+
205
+ Probability calibration should be evaluated separately if the model's output is to be interpreted probabilistically.
206
+
207
+ ---
208
+
209
+ # Feature Set
210
+
211
+ The model uses 221 features.
212
+
213
+ Examples of macro and cross-market features include:
214
+
215
+ ```text
216
+ usd_inr_sma20_ratio
217
+ usd_inr_sma200_ratio
218
+ usd_inr_momentum_10
219
+ usd_inr_momentum_20
220
+ usd_inr_volatility_20d
221
+ usd_inr_trend
222
+ usd_inr_zscore
223
+ usd_inr_vol_zscore
224
+ usd_inr_high_vol
225
+ usd_inr_appreciation
226
+
227
+ us_ret_1d
228
+ us_ret_5d
229
+ us_ret_20d
230
+ us_ret_60d
231
+
232
+ us_breadth_1d
233
+ us_breadth_5d
234
+ us_breadth_20d
235
+
236
+ us_dispersion_1d
237
+ us_dispersion_5d
238
+ us_avg_vol_ratio
239
+ us_pct_above_sma20
240
+ us_avg_rsi
241
+ us_avg_dist_52w_high
242
+
243
+ corr_nifty_20d
244
+ corr_nifty_60d
245
+ beta_nifty_60d
246
+ is_high_beta
247
+ is_low_beta
248
+ corr_breakdown
249
+
250
+ rel_strength_5d
251
+ rel_strength_20d
252
+
253
+ corr_gold_60d
254
+ corr_gold_rising
255
+
256
+ corr_brent_60d
257
+ corr_brent_rising
258
+
259
+ corr_usd_inr_60d
260
+ corr_usd_inr_rising
261
+
262
+ corr_us_60d
263
+ ```
264
+
265
+ The complete feature schema is available in `model_metadata.json`.
266
+
267
+ ---
268
+
269
+ # Model Artifacts
270
+
271
+ The repository contains the following artifacts:
272
+
273
+ | File | Description |
274
+ | ----------------------------- | --------------------------------------------------------------------------------- |
275
+ | `xgb_model.json` | Trained XGBoost model |
276
+ | `model_metadata.json` | Training configuration, feature schema, split information and evaluation metadata |
277
+ | `feature_importance.csv` | XGBoost feature-importance statistics |
278
+ | `val_predictions.parquet` | Validation predictions |
279
+ | `test_wf_predictions.parquet` | Chronological walk-forward test predictions |
280
+
281
+ The prediction files are provided to make the reported evaluation results independently inspectable and reproducible.
282
+
283
+ ---
284
+
285
+ # Reproducibility
286
+
287
+ The model metadata records:
288
+
289
+ * Feature names
290
+ * Feature count
291
+ * Dataset information
292
+ * Training period
293
+ * Validation period
294
+ * Model parameters
295
+ * Class weighting
296
+ * Best iteration
297
+ * Evaluation metrics
298
+ * Training timestamp
299
+
300
+ The model uses a fixed random seed of `42`.
301
+
302
+ ---
303
+
304
+ # Important Limitations
305
+
306
+ This model should be considered a **research artifact**, not a guaranteed trading system.
307
+
308
+ The reported classification metrics do not directly measure:
309
+
310
+ * Portfolio returns
311
+ * Sharpe ratio
312
+ * Maximum drawdown
313
+ * Transaction costs
314
+ * Brokerage
315
+ * Taxes
316
+ * Slippage
317
+ * Bid/ask spread
318
+ * Market impact
319
+ * Position sizing
320
+ * Portfolio concentration
321
+ * Liquidity constraints
322
+ * Capacity
323
+ * Execution latency
324
+
325
+ A model can achieve strong classification metrics while producing poor investment returns after these factors are considered.
326
+
327
+ The target is also a classification threshold rather than a direct optimization of portfolio returns.
328
+
329
+ Additional research is therefore required before using the model for live decision-making.
330
+
331
+ ---
332
+
333
+ # Current Research Status
334
+
335
+ The current experiment establishes a useful baseline for the **+3.0% / 5-trading-day** prediction task.
336
+
337
+ The next stages of research should include:
338
+
339
+ 1. Additional temporal walk-forward experiments.
340
+ 2. Comparison of model complexity and boosting-round counts.
341
+ 3. Testing alternative return thresholds and horizons.
342
+ 4. Feature ablation and importance stability analysis.
343
+ 5. Leakage and feature-timing audits.
344
+ 6. Performance analysis by market regime.
345
+ 7. Calibration analysis on completely unseen periods.
346
+ 8. Portfolio-level backtesting.
347
+ 9. Transaction-cost and slippage modelling.
348
+ 10. Paper-trading validation before considering live deployment.
349
+
350
+ ---
351
+
352
+ # License
353
+
354
+ This model is published under the **Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)** license.
355
+
356
+ The license permits non-commercial use subject to the terms of the license.
357
+
358
+ Commercial use requires appropriate licensing.
359
+
360
+ ---
361
+
362
+ # Author
363
+
364
+ [**Sayantan Basu**](https://sayantan-basu.vercel.app)
feature_importance.csv ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ feature,gain,cover,weight
2
+ f1,5325.15283203125,68459.6328125,4698.0
3
+ f7,4115.845703125,68196.3984375,1120.0
4
+ f31,3964.971923828125,84257.1875,2079.0
5
+ f36,3366.510986328125,47373.79296875,1538.0
6
+ f212,1568.135498046875,35672.390625,1186.0
7
+ f2,1246.1517333984375,47140.26953125,4120.0
8
+ f8,1101.158447265625,44323.390625,947.0
9
+ f17,931.3317260742188,40531.37890625,1520.0
10
+ f32,862.3289184570312,37222.3828125,713.0
11
+ f0,711.5985717773438,31164.341796875,5577.0
12
+ f39,663.1898803710938,39934.984375,1691.0
13
+ f38,642.7109375,23749.849609375,2272.0
14
+ f6,605.0057983398438,29368.93359375,1538.0
15
+ f40,541.1348876953125,39109.171875,2041.0
16
+ f54,525.8748779296875,40191.59375,2955.0
17
+ f69,480.3856506347656,27513.529296875,5197.0
18
+ f46,454.45880126953125,34922.32421875,1173.0
19
+ f41,445.4704284667969,86219.9296875,1134.0
20
+ f61,413.2144775390625,64463.95703125,245.0
21
+ f76,397.5409240722656,63324.75390625,710.0
22
+ f34,336.4801025390625,36437.12109375,1087.0
23
+ f45,310.4357604980469,65585.1015625,1011.0
24
+ f115,282.82122802734375,25716.794921875,390.0
25
+ f44,271.93890380859375,103531.15625,2181.0
26
+ f210,262.3323974609375,24503.73046875,227.0
27
+ f16,261.62164306640625,137480.15625,1655.0
28
+ f58,258.2943420410156,21659.6640625,861.0
29
+ f33,230.97845458984375,69676.015625,1033.0
30
+ f53,209.64468383789062,35103.75390625,2001.0
31
+ f71,203.9341583251953,55411.87890625,253.0
32
+ f75,200.1075897216797,34342.58984375,160.0
33
+ f21,193.40286254882812,55620.0859375,688.0
34
+ f193,179.60198974609375,52923.33203125,742.0
35
+ f59,173.84181213378906,23193.08203125,1193.0
36
+ f70,172.29080200195312,48352.68359375,386.0
37
+ f72,171.29737854003906,34841.23046875,617.0
38
+ f147,168.84896850585938,26952.25390625,422.0
39
+ f208,167.88539123535156,11878.2275390625,726.0
40
+ f51,159.6352996826172,80163.8828125,1763.0
41
+ f18,158.70263671875,34064.16015625,389.0
42
+ f124,152.9352264404297,46631.21875,732.0
43
+ f171,151.54481506347656,29977.30859375,593.0
44
+ f126,151.440185546875,48580.6015625,528.0
45
+ f47,150.7949981689453,108855.953125,717.0
46
+ f207,143.04129028320312,18832.865234375,889.0
47
+ f56,140.55490112304688,73637.28125,1255.0
48
+ f104,140.51597595214844,26177.23828125,748.0
49
+ f144,139.98495483398438,63243.3828125,780.0
50
+ f101,137.34207153320312,25784.041015625,585.0
51
+ f55,134.55760192871094,23258.4375,1728.0
52
+ f187,133.2763214111328,37959.5546875,572.0
53
+ f121,130.02809143066406,37742.1328125,497.0
54
+ f91,129.34507751464844,13051.0419921875,12.0
55
+ f202,126.53907775878906,73390.328125,604.0
56
+ f133,126.4417953491211,11295.861328125,30.0
57
+ f117,124.9978256225586,27211.66015625,314.0
58
+ f162,122.44957733154297,51836.9453125,457.0
59
+ f94,119.9894027709961,41162.88671875,278.0
60
+ f3,119.62555694580078,33655.30859375,1124.0
61
+ f122,117.14742279052734,48230.12890625,439.0
62
+ f160,116.41017150878906,23336.771484375,477.0
63
+ f89,116.15287780761719,22684.0,201.0
64
+ f118,115.3116455078125,46612.140625,366.0
65
+ f204,114.83635711669922,30698.259765625,504.0
66
+ f116,114.74333953857422,33482.84375,204.0
67
+ f195,110.9507064819336,35621.69140625,310.0
68
+ f189,110.81322479248047,27497.9765625,340.0
69
+ f113,109.75797271728516,47348.70703125,410.0
70
+ f62,108.93269348144531,11772.4384765625,92.0
71
+ f77,108.42366790771484,15604.078125,93.0
72
+ f9,107.12332153320312,34515.3203125,258.0
73
+ f107,106.64046478271484,27238.91015625,421.0
74
+ f190,105.9676513671875,55963.65625,512.0
75
+ f209,105.63643646240234,18306.990234375,18.0
76
+ f120,105.44498443603516,33585.53515625,151.0
77
+ f100,105.1141586303711,30311.248046875,214.0
78
+ f206,104.19023895263672,25035.544921875,838.0
79
+ f60,104.06464385986328,52803.38671875,1001.0
80
+ f174,103.52881622314453,50983.33203125,419.0
81
+ f80,103.49224853515625,23656.63671875,331.0
82
+ f114,103.38029479980469,34085.8203125,212.0
83
+ f84,103.3167953491211,23147.216796875,189.0
84
+ f74,103.16171264648438,14252.2353515625,274.0
85
+ f177,102.72142028808594,54082.24609375,446.0
86
+ f176,102.30437469482422,35788.20703125,507.0
87
+ f99,100.70491027832031,24830.2890625,314.0
88
+ f164,100.23468017578125,15831.5263671875,447.0
89
+ f197,100.16085815429688,47805.38671875,528.0
90
+ f95,99.98596954345703,70329.3125,308.0
91
+ f105,99.74986267089844,17183.33203125,252.0
92
+ f81,98.96772003173828,20864.2421875,174.0
93
+ f145,98.55354309082031,34898.09765625,533.0
94
+ f87,98.32896423339844,33892.73828125,254.0
95
+ f88,97.87724304199219,33016.03515625,540.0
96
+ f199,97.772216796875,36230.62890625,290.0
97
+ f103,97.72587585449219,70409.0234375,597.0
98
+ f37,97.67594909667969,25916.970703125,938.0
99
+ f42,96.77252197265625,105556.59375,393.0
100
+ f125,96.10755157470703,28639.498046875,506.0
101
+ f93,96.08097839355469,19186.265625,195.0
102
+ f185,95.93507385253906,42764.640625,357.0
103
+ f73,95.1639175415039,12892.740234375,376.0
104
+ f106,94.98686981201172,12041.0986328125,274.0
105
+ f158,94.78166198730469,46203.0390625,332.0
106
+ f148,94.68411254882812,17762.63671875,420.0
107
+ f184,94.28591918945312,35923.99609375,374.0
108
+ f200,94.15950012207031,22957.810546875,496.0
109
+ f194,93.82621765136719,47455.30078125,369.0
110
+ f159,92.949462890625,48539.140625,417.0
111
+ f136,92.61298370361328,24385.689453125,130.0
112
+ f169,92.01233673095703,26766.517578125,434.0
113
+ f175,91.8438949584961,23843.4921875,24.0
114
+ f112,91.71309661865234,21628.4375,332.0
115
+ f109,91.03904724121094,42846.83203125,316.0
116
+ f155,90.6822509765625,42451.6171875,531.0
117
+ f85,90.68136596679688,16686.9296875,201.0
118
+ f149,90.15928649902344,23711.46875,299.0
119
+ f119,90.08594512939453,29264.630859375,330.0
120
+ f150,89.9566879272461,31202.34765625,288.0
121
+ f201,89.85118865966797,67483.9140625,443.0
122
+ f96,89.83715057373047,34116.7421875,31.0
123
+ f198,89.6642837524414,19943.99609375,366.0
124
+ f178,89.26366424560547,20985.14453125,3.0
125
+ f156,88.75489044189453,14283.2734375,479.0
126
+ f196,88.1899185180664,34676.578125,357.0
127
+ f181,87.97608184814453,16436.32421875,420.0
128
+ f86,87.14678192138672,45750.26171875,344.0
129
+ f102,86.903564453125,27558.8515625,101.0
130
+ f137,86.66979217529297,16996.958984375,335.0
131
+ f35,86.66337585449219,19229.359375,853.0
132
+ f143,86.6239013671875,34069.375,430.0
133
+ f79,86.37348175048828,14398.39453125,77.0
134
+ f68,86.13903045654297,31897.810546875,26.0
135
+ f50,85.54434967041016,16195.123046875,894.0
136
+ f205,84.95002746582031,46978.07421875,315.0
137
+ f170,84.76980590820312,22305.462890625,288.0
138
+ f146,84.572021484375,29964.841796875,373.0
139
+ f111,84.1866683959961,17010.32421875,172.0
140
+ f22,83.09573364257812,38828.37890625,102.0
141
+ f82,82.84314727783203,20371.6328125,214.0
142
+ f168,82.41185760498047,18014.60546875,432.0
143
+ f83,82.0250015258789,41562.01171875,254.0
144
+ f135,81.65332794189453,22148.048828125,53.0
145
+ f90,81.2519302368164,31081.951171875,58.0
146
+ f180,81.17967987060547,36046.203125,576.0
147
+ f203,80.814208984375,47314.7578125,206.0
148
+ f172,80.73104858398438,36601.875,381.0
149
+ f123,80.26925659179688,54063.109375,605.0
150
+ f92,80.21176147460938,32615.755859375,91.0
151
+ f78,79.47978210449219,15207.662109375,290.0
152
+ f129,78.6848373413086,21271.150390625,441.0
153
+ f4,78.42843627929688,27709.818359375,425.0
154
+ f161,77.77777099609375,12504.84375,80.0
155
+ f127,76.01110076904297,18625.470703125,475.0
156
+ f182,75.88616943359375,23327.3515625,328.0
157
+ f128,75.36719512939453,25060.37890625,522.0
158
+ f157,75.3602523803711,17789.9921875,375.0
159
+ f140,75.35004425048828,1243.0164794921875,7.0
160
+ f98,75.3267822265625,57301.0234375,55.0
161
+ f63,75.08702087402344,26990.11328125,42.0
162
+ f183,74.89909362792969,46639.00390625,302.0
163
+ f108,74.82830810546875,29040.123046875,351.0
164
+ f179,74.61183166503906,2816.818603515625,11.0
165
+ f19,74.30308532714844,43849.71484375,443.0
166
+ f165,74.28292846679688,20069.68359375,395.0
167
+ f132,74.1614761352539,15046.2412109375,35.0
168
+ f186,74.01150512695312,33781.50390625,101.0
169
+ f167,73.72079467773438,38586.2421875,632.0
170
+ f43,71.59841918945312,106947.28125,660.0
171
+ f25,70.65673828125,21007.630859375,497.0
172
+ f173,69.72639465332031,15993.78125,91.0
173
+ f110,66.60283660888672,14914.7578125,123.0
174
+ f28,66.08335876464844,13683.634765625,100.0
175
+ f130,65.740478515625,5876.8193359375,8.0
176
+ f48,65.69597625732422,35550.25,338.0
177
+ f213,65.62059783935547,16225.6953125,369.0
178
+ f97,65.50997924804688,24648.734375,58.0
179
+ f10,63.9237174987793,34336.09375,98.0
180
+ f66,63.57122802734375,20479.8828125,103.0
181
+ f49,60.27708435058594,65060.7421875,808.0
182
+ f52,59.52656936645508,88758.9609375,575.0
183
+ f26,59.4591064453125,16305.6259765625,350.0
184
+ f23,58.429962158203125,61881.41796875,24.0
185
+ f57,58.29280471801758,19692.81640625,565.0
186
+ f217,54.119808197021484,54751.8984375,79.0
187
+ f188,54.1160774230957,15875.8408203125,15.0
188
+ f131,52.61231231689453,7133.201171875,9.0
189
+ f13,52.04670333862305,9690.5986328125,342.0
190
+ f214,50.24469757080078,10094.3896484375,203.0
191
+ f192,49.956268310546875,2488.151123046875,5.0
192
+ f29,48.838172912597656,69915.8828125,82.0
193
+ f220,47.30107116699219,13698.185546875,318.0
194
+ f64,46.715728759765625,161601.984375,43.0
195
+ f27,46.69657897949219,139887.625,475.0
196
+ f152,45.48809814453125,2539.578125,2.0
197
+ f67,44.294769287109375,26379.634765625,89.0
198
+ f14,44.26970672607422,45942.2265625,280.0
199
+ f191,44.25852966308594,5971.04736328125,3.0
200
+ f20,44.10636520385742,27274.34765625,372.0
201
+ f163,42.733341217041016,2792.3251953125,15.0
202
+ f24,41.456214904785156,9650.279296875,11.0
203
+ f218,38.22769546508789,44201.6640625,236.0
204
+ f5,36.669883728027344,7017.15087890625,222.0
205
+ f216,36.60192108154297,1729.5841064453125,227.0
206
+ f215,35.5046501159668,2211.857666015625,36.0
207
+ f134,34.91355895996094,5789.205078125,4.0
208
+ f15,34.72055435180664,3006.513427734375,178.0
209
+ f11,34.5792121887207,10816.3876953125,69.0
210
+ f30,31.092498779296875,10023.046875,47.0
211
+ f219,30.997909545898438,600.1138916015625,47.0
212
+ f166,28.914865493774414,3055.8466796875,3.0
213
+ f65,22.219697952270508,37947.83984375,3.0
214
+ f12,21.965524673461914,2735.67236328125,188.0
215
+ f153,21.305362701416016,1729.6878662109375,1.0
216
+ f211,19.016956329345703,984.0364379882812,5.0
latest.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "version": "20260809_095516"
3
+ }
model_metadata.json ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "trained_at": "2026-08-09T12:34:20.758570",
3
+ "mode": "scratch",
4
+ "train_end": "2021-02-15 00:00:00",
5
+ "val_end": "2024-08-30 00:00:00",
6
+ "feature_cols": [
7
+ "log_ret_1d",
8
+ "log_ret_3d",
9
+ "log_ret_5d",
10
+ "log_ret_10d",
11
+ "log_ret_20d",
12
+ "log_ret_60d",
13
+ "ret_1d",
14
+ "ret_3d",
15
+ "ret_5d",
16
+ "ret_10d",
17
+ "ret_20d",
18
+ "ret_60d",
19
+ "ret_120d",
20
+ "close_sma20_ratio",
21
+ "close_sma50_ratio",
22
+ "close_sma200_ratio",
23
+ "close_ema20_ratio",
24
+ "high_20_position",
25
+ "low_20_position",
26
+ "close_to_52w_high",
27
+ "close_to_52w_low",
28
+ "position_in_20d_range",
29
+ "roc_10",
30
+ "roc_20",
31
+ "roc_60",
32
+ "momentum_10",
33
+ "momentum_20",
34
+ "ppo",
35
+ "dist_sma20",
36
+ "dist_sma50",
37
+ "dist_sma200",
38
+ "vol_10",
39
+ "vol_20",
40
+ "vol_60",
41
+ "vol_ratio",
42
+ "atr_14",
43
+ "atr_percent",
44
+ "parkinson_volatility",
45
+ "adx_14",
46
+ "di_plus",
47
+ "di_minus",
48
+ "aroon_up",
49
+ "aroon_down",
50
+ "rsi_14",
51
+ "rsi_7",
52
+ "cci_20",
53
+ "stochastic_k",
54
+ "macd",
55
+ "macd_signal",
56
+ "macd_histogram",
57
+ "bb_width",
58
+ "bb_position",
59
+ "bb_squeeze",
60
+ "intraday_range",
61
+ "gap",
62
+ "close_position",
63
+ "volume_ratio",
64
+ "mfi",
65
+ "body_percent",
66
+ "upper_shadow_percent",
67
+ "lower_shadow_percent",
68
+ "gap_up",
69
+ "gap_down",
70
+ "inside_day",
71
+ "outside_day",
72
+ "doji",
73
+ "distance_from_52w_high",
74
+ "distance_from_52w_low",
75
+ "rolling_drawdown",
76
+ "day_of_week",
77
+ "month",
78
+ "is_month_end",
79
+ "nifty_log_ret_1d",
80
+ "nifty_log_ret_5d",
81
+ "nifty_log_ret_20d",
82
+ "nifty_ret_1d",
83
+ "nifty_ret_3d",
84
+ "nifty_ret_5d",
85
+ "nifty_ret_10d",
86
+ "nifty_ret_20d",
87
+ "nifty_ret_60d",
88
+ "nifty_close_sma20_ratio",
89
+ "nifty_close_sma50_ratio",
90
+ "nifty_close_sma200_ratio",
91
+ "nifty_close_ema20_ratio",
92
+ "nifty_high_20_position",
93
+ "nifty_low_20_position",
94
+ "nifty_close_to_52w_high",
95
+ "nifty_close_to_52w_low",
96
+ "nifty_position_in_20d_range",
97
+ "nifty_roc_10",
98
+ "nifty_roc_20",
99
+ "nifty_roc_60",
100
+ "nifty_momentum_10",
101
+ "nifty_momentum_20",
102
+ "nifty_ppo",
103
+ "nifty_dist_sma20",
104
+ "nifty_dist_sma50",
105
+ "nifty_dist_sma200",
106
+ "nifty_vol_10",
107
+ "nifty_vol_20",
108
+ "nifty_vol_60",
109
+ "nifty_rolling_volatility",
110
+ "nifty_vol_ratio",
111
+ "nifty_atr_14",
112
+ "nifty_atr_percent",
113
+ "nifty_parkinson_volatility",
114
+ "nifty_adx_14",
115
+ "nifty_di_plus",
116
+ "nifty_di_minus",
117
+ "nifty_aroon_up",
118
+ "nifty_aroon_down",
119
+ "nifty_rsi_14",
120
+ "nifty_rsi_7",
121
+ "nifty_cci_20",
122
+ "nifty_stochastic_k",
123
+ "nifty_macd",
124
+ "nifty_macd_signal",
125
+ "nifty_macd_histogram",
126
+ "nifty_bb_width",
127
+ "nifty_bb_position",
128
+ "nifty_bb_squeeze",
129
+ "nifty_intraday_range",
130
+ "nifty_gap",
131
+ "nifty_close_position",
132
+ "nifty_volume_ratio",
133
+ "nifty_mfi",
134
+ "nifty_body_percent",
135
+ "nifty_upper_shadow_percent",
136
+ "nifty_lower_shadow_percent",
137
+ "nifty_gap_up",
138
+ "nifty_gap_down",
139
+ "nifty_inside_day",
140
+ "nifty_outside_day",
141
+ "nifty_doji",
142
+ "nifty_distance_from_52w_high",
143
+ "nifty_distance_from_52w_low",
144
+ "nifty_rolling_drawdown",
145
+ "nifty_bull_market",
146
+ "nifty_bear_market",
147
+ "nifty_strong_trend",
148
+ "nifty_positive_20d",
149
+ "nifty_positive_60d",
150
+ "close_1",
151
+ "vix_return_1d",
152
+ "vix_return_5d",
153
+ "vix_return_20d",
154
+ "vix_ma20",
155
+ "vix_volatility",
156
+ "vix_zscore",
157
+ "vix_percentile",
158
+ "high_vol_regime",
159
+ "low_vol_regime",
160
+ "extreme_fear",
161
+ "extreme_calm",
162
+ "gold_ret_1d",
163
+ "gold_ret_5d",
164
+ "gold_ret_20d",
165
+ "gold_sma20_ratio",
166
+ "gold_sma200_ratio",
167
+ "gold_momentum_10",
168
+ "gold_momentum_20",
169
+ "gold_volatility_20d",
170
+ "gold_trend",
171
+ "gold_zscore",
172
+ "gold_vol_zscore",
173
+ "gold_high_vol",
174
+ "brent_ret_1d",
175
+ "brent_ret_5d",
176
+ "brent_ret_20d",
177
+ "brent_sma20_ratio",
178
+ "brent_sma200_ratio",
179
+ "brent_momentum_10",
180
+ "brent_momentum_20",
181
+ "brent_volatility_20d",
182
+ "brent_trend",
183
+ "brent_zscore",
184
+ "brent_vol_zscore",
185
+ "brent_high_vol",
186
+ "brent_spike",
187
+ "usd_inr_ret_1d",
188
+ "usd_inr_ret_5d",
189
+ "usd_inr_ret_20d",
190
+ "usd_inr_sma20_ratio",
191
+ "usd_inr_sma200_ratio",
192
+ "usd_inr_momentum_10",
193
+ "usd_inr_momentum_20",
194
+ "usd_inr_volatility_20d",
195
+ "usd_inr_trend",
196
+ "usd_inr_zscore",
197
+ "usd_inr_vol_zscore",
198
+ "usd_inr_high_vol",
199
+ "usd_inr_appreciation",
200
+ "us_ret_1d",
201
+ "us_ret_5d",
202
+ "us_ret_20d",
203
+ "us_ret_60d",
204
+ "us_breadth_1d",
205
+ "us_breadth_5d",
206
+ "us_breadth_20d",
207
+ "us_dispersion_1d",
208
+ "us_dispersion_5d",
209
+ "us_avg_vol_ratio",
210
+ "us_pct_above_sma20",
211
+ "us_avg_rsi",
212
+ "us_avg_dist_52w_high",
213
+ "corr_nifty_20d",
214
+ "corr_nifty_60d",
215
+ "beta_nifty_60d",
216
+ "is_high_beta",
217
+ "is_low_beta",
218
+ "corr_breakdown",
219
+ "rel_strength_5d",
220
+ "rel_strength_20d",
221
+ "corr_gold_60d",
222
+ "corr_gold_rising",
223
+ "corr_brent_60d",
224
+ "corr_brent_rising",
225
+ "corr_usd_inr_60d",
226
+ "corr_usd_inr_rising",
227
+ "corr_us_60d"
228
+ ],
229
+ "total_features": 221,
230
+ "best_iteration": 1999,
231
+ "params": {
232
+ "objective": "binary:logistic",
233
+ "eval_metric": "aucpr",
234
+ "tree_method": "hist",
235
+ "device": "cuda",
236
+ "learning_rate": 0.02,
237
+ "max_depth": 6,
238
+ "subsample": 0.75,
239
+ "colsample_bytree": 0.75,
240
+ "min_child_weight": 20,
241
+ "gamma": 0.1,
242
+ "reg_alpha": 0.1,
243
+ "reg_lambda": 1.0,
244
+ "seed": 42,
245
+ "max_bin": 256,
246
+ "n_estimators": 2000
247
+ },
248
+ "metrics": {
249
+ "val": {
250
+ "pr_auc": 0.9042,
251
+ "roc_auc": 0.9472,
252
+ "precision": 0.7981,
253
+ "recall": 0.8364,
254
+ "ic": 0.714,
255
+ "n_rows": 1698058,
256
+ "pos_rate": 0.3062,
257
+ "brier_score": 0.0835,
258
+ "brier_skill_score": 0.6068000197410583,
259
+ "mean_calib_error": 0.0749,
260
+ "no_skill_brier": 0.21240000426769257,
261
+ "calibration_curve": {
262
+ "fraction_of_positives": [
263
+ 0.015583287674426738,
264
+ 0.07435920568570255,
265
+ 0.14871492862667884,
266
+ 0.236217017491847,
267
+ 0.32711561210652357,
268
+ 0.42616482259908844,
269
+ 0.5483246365396607,
270
+ 0.6818195209616121,
271
+ 0.821664709208752,
272
+ 0.966290848301184
273
+ ],
274
+ "mean_predicted_prob": [
275
+ 0.03545770506861525,
276
+ 0.1437372801748982,
277
+ 0.24671069988005753,
278
+ 0.34814692895842914,
279
+ 0.4489718037772851,
280
+ 0.5493239582662961,
281
+ 0.6504352846764856,
282
+ 0.751485701542276,
283
+ 0.85354191677695,
284
+ 0.9652750704686287
285
+ ]
286
+ }
287
+ },
288
+ "test_wf": {
289
+ "folds": [
290
+ {
291
+ "fold": 1,
292
+ "start": "2024-09-01",
293
+ "end": "2025-02-28",
294
+ "pr_auc": 0.9336,
295
+ "ic": 0.7619,
296
+ "brier": 0.085,
297
+ "n_rows": 262062,
298
+ "pos_rate": 0.386
299
+ },
300
+ {
301
+ "fold": 2,
302
+ "start": "2025-03-01",
303
+ "end": "2025-08-31",
304
+ "pr_auc": 0.8987,
305
+ "ic": 0.7044,
306
+ "brier": 0.0829,
307
+ "n_rows": 266786,
308
+ "pos_rate": 0.3005
309
+ },
310
+ {
311
+ "fold": 3,
312
+ "start": "2025-09-01",
313
+ "end": "2026-02-28",
314
+ "pr_auc": 0.8921,
315
+ "ic": 0.7011,
316
+ "brier": 0.0845,
317
+ "n_rows": 282585,
318
+ "pos_rate": 0.3007
319
+ },
320
+ {
321
+ "fold": 4,
322
+ "start": "2026-03-01",
323
+ "end": "2026-06-30",
324
+ "pr_auc": 0.8962,
325
+ "ic": 0.7157,
326
+ "brier": 0.0925,
327
+ "n_rows": 180837,
328
+ "pos_rate": 0.3352
329
+ }
330
+ ],
331
+ "mean_pr_auc": 0.9052,
332
+ "mean_ic": 0.7208,
333
+ "mean_brier": 0.0862
334
+ }
335
+ },
336
+ "class_balance": {
337
+ "total": 4231195,
338
+ "positive": 1701894,
339
+ "negative": 2529301,
340
+ "pos_rate": 0.4022,
341
+ "neg_rate": 0.5978,
342
+ "spw": 1.4862
343
+ },
344
+ "dataset": "/run/media/lucifer/developer/Developer/stock_model/Dataset/Processed_dataset/labeled_dataset_ml/ml_training_dataset_3.0pct_5days.parquet",
345
+ "run_dir": "/run/media/lucifer/developer/Developer/stock_model/models/runs/20260809_095516"
346
+ }
versions/20260809_095516/calibration.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "val": {
3
+ "brier_score": 0.0835,
4
+ "brier_skill_score": 0.6068000197410583,
5
+ "mean_calib_error": 0.0749,
6
+ "calibration_curve": {
7
+ "fraction_of_positives": [
8
+ 0.015583287674426738,
9
+ 0.07435920568570255,
10
+ 0.14871492862667884,
11
+ 0.236217017491847,
12
+ 0.32711561210652357,
13
+ 0.42616482259908844,
14
+ 0.5483246365396607,
15
+ 0.6818195209616121,
16
+ 0.821664709208752,
17
+ 0.966290848301184
18
+ ],
19
+ "mean_predicted_prob": [
20
+ 0.03545770506861525,
21
+ 0.1437372801748982,
22
+ 0.24671069988005753,
23
+ 0.34814692895842914,
24
+ 0.4489718037772851,
25
+ 0.5493239582662961,
26
+ 0.6504352846764856,
27
+ 0.751485701542276,
28
+ 0.85354191677695,
29
+ 0.9652750704686287
30
+ ]
31
+ }
32
+ },
33
+ "test_wf": {}
34
+ }
versions/20260809_095516/run_metadata.json ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "trained_at": "2026-08-09T12:34:20.758570",
3
+ "mode": "scratch",
4
+ "train_end": "2021-02-15 00:00:00",
5
+ "val_end": "2024-08-30 00:00:00",
6
+ "feature_cols": [
7
+ "log_ret_1d",
8
+ "log_ret_3d",
9
+ "log_ret_5d",
10
+ "log_ret_10d",
11
+ "log_ret_20d",
12
+ "log_ret_60d",
13
+ "ret_1d",
14
+ "ret_3d",
15
+ "ret_5d",
16
+ "ret_10d",
17
+ "ret_20d",
18
+ "ret_60d",
19
+ "ret_120d",
20
+ "close_sma20_ratio",
21
+ "close_sma50_ratio",
22
+ "close_sma200_ratio",
23
+ "close_ema20_ratio",
24
+ "high_20_position",
25
+ "low_20_position",
26
+ "close_to_52w_high",
27
+ "close_to_52w_low",
28
+ "position_in_20d_range",
29
+ "roc_10",
30
+ "roc_20",
31
+ "roc_60",
32
+ "momentum_10",
33
+ "momentum_20",
34
+ "ppo",
35
+ "dist_sma20",
36
+ "dist_sma50",
37
+ "dist_sma200",
38
+ "vol_10",
39
+ "vol_20",
40
+ "vol_60",
41
+ "vol_ratio",
42
+ "atr_14",
43
+ "atr_percent",
44
+ "parkinson_volatility",
45
+ "adx_14",
46
+ "di_plus",
47
+ "di_minus",
48
+ "aroon_up",
49
+ "aroon_down",
50
+ "rsi_14",
51
+ "rsi_7",
52
+ "cci_20",
53
+ "stochastic_k",
54
+ "macd",
55
+ "macd_signal",
56
+ "macd_histogram",
57
+ "bb_width",
58
+ "bb_position",
59
+ "bb_squeeze",
60
+ "intraday_range",
61
+ "gap",
62
+ "close_position",
63
+ "volume_ratio",
64
+ "mfi",
65
+ "body_percent",
66
+ "upper_shadow_percent",
67
+ "lower_shadow_percent",
68
+ "gap_up",
69
+ "gap_down",
70
+ "inside_day",
71
+ "outside_day",
72
+ "doji",
73
+ "distance_from_52w_high",
74
+ "distance_from_52w_low",
75
+ "rolling_drawdown",
76
+ "day_of_week",
77
+ "month",
78
+ "is_month_end",
79
+ "nifty_log_ret_1d",
80
+ "nifty_log_ret_5d",
81
+ "nifty_log_ret_20d",
82
+ "nifty_ret_1d",
83
+ "nifty_ret_3d",
84
+ "nifty_ret_5d",
85
+ "nifty_ret_10d",
86
+ "nifty_ret_20d",
87
+ "nifty_ret_60d",
88
+ "nifty_close_sma20_ratio",
89
+ "nifty_close_sma50_ratio",
90
+ "nifty_close_sma200_ratio",
91
+ "nifty_close_ema20_ratio",
92
+ "nifty_high_20_position",
93
+ "nifty_low_20_position",
94
+ "nifty_close_to_52w_high",
95
+ "nifty_close_to_52w_low",
96
+ "nifty_position_in_20d_range",
97
+ "nifty_roc_10",
98
+ "nifty_roc_20",
99
+ "nifty_roc_60",
100
+ "nifty_momentum_10",
101
+ "nifty_momentum_20",
102
+ "nifty_ppo",
103
+ "nifty_dist_sma20",
104
+ "nifty_dist_sma50",
105
+ "nifty_dist_sma200",
106
+ "nifty_vol_10",
107
+ "nifty_vol_20",
108
+ "nifty_vol_60",
109
+ "nifty_rolling_volatility",
110
+ "nifty_vol_ratio",
111
+ "nifty_atr_14",
112
+ "nifty_atr_percent",
113
+ "nifty_parkinson_volatility",
114
+ "nifty_adx_14",
115
+ "nifty_di_plus",
116
+ "nifty_di_minus",
117
+ "nifty_aroon_up",
118
+ "nifty_aroon_down",
119
+ "nifty_rsi_14",
120
+ "nifty_rsi_7",
121
+ "nifty_cci_20",
122
+ "nifty_stochastic_k",
123
+ "nifty_macd",
124
+ "nifty_macd_signal",
125
+ "nifty_macd_histogram",
126
+ "nifty_bb_width",
127
+ "nifty_bb_position",
128
+ "nifty_bb_squeeze",
129
+ "nifty_intraday_range",
130
+ "nifty_gap",
131
+ "nifty_close_position",
132
+ "nifty_volume_ratio",
133
+ "nifty_mfi",
134
+ "nifty_body_percent",
135
+ "nifty_upper_shadow_percent",
136
+ "nifty_lower_shadow_percent",
137
+ "nifty_gap_up",
138
+ "nifty_gap_down",
139
+ "nifty_inside_day",
140
+ "nifty_outside_day",
141
+ "nifty_doji",
142
+ "nifty_distance_from_52w_high",
143
+ "nifty_distance_from_52w_low",
144
+ "nifty_rolling_drawdown",
145
+ "nifty_bull_market",
146
+ "nifty_bear_market",
147
+ "nifty_strong_trend",
148
+ "nifty_positive_20d",
149
+ "nifty_positive_60d",
150
+ "close_1",
151
+ "vix_return_1d",
152
+ "vix_return_5d",
153
+ "vix_return_20d",
154
+ "vix_ma20",
155
+ "vix_volatility",
156
+ "vix_zscore",
157
+ "vix_percentile",
158
+ "high_vol_regime",
159
+ "low_vol_regime",
160
+ "extreme_fear",
161
+ "extreme_calm",
162
+ "gold_ret_1d",
163
+ "gold_ret_5d",
164
+ "gold_ret_20d",
165
+ "gold_sma20_ratio",
166
+ "gold_sma200_ratio",
167
+ "gold_momentum_10",
168
+ "gold_momentum_20",
169
+ "gold_volatility_20d",
170
+ "gold_trend",
171
+ "gold_zscore",
172
+ "gold_vol_zscore",
173
+ "gold_high_vol",
174
+ "brent_ret_1d",
175
+ "brent_ret_5d",
176
+ "brent_ret_20d",
177
+ "brent_sma20_ratio",
178
+ "brent_sma200_ratio",
179
+ "brent_momentum_10",
180
+ "brent_momentum_20",
181
+ "brent_volatility_20d",
182
+ "brent_trend",
183
+ "brent_zscore",
184
+ "brent_vol_zscore",
185
+ "brent_high_vol",
186
+ "brent_spike",
187
+ "usd_inr_ret_1d",
188
+ "usd_inr_ret_5d",
189
+ "usd_inr_ret_20d",
190
+ "usd_inr_sma20_ratio",
191
+ "usd_inr_sma200_ratio",
192
+ "usd_inr_momentum_10",
193
+ "usd_inr_momentum_20",
194
+ "usd_inr_volatility_20d",
195
+ "usd_inr_trend",
196
+ "usd_inr_zscore",
197
+ "usd_inr_vol_zscore",
198
+ "usd_inr_high_vol",
199
+ "usd_inr_appreciation",
200
+ "us_ret_1d",
201
+ "us_ret_5d",
202
+ "us_ret_20d",
203
+ "us_ret_60d",
204
+ "us_breadth_1d",
205
+ "us_breadth_5d",
206
+ "us_breadth_20d",
207
+ "us_dispersion_1d",
208
+ "us_dispersion_5d",
209
+ "us_avg_vol_ratio",
210
+ "us_pct_above_sma20",
211
+ "us_avg_rsi",
212
+ "us_avg_dist_52w_high",
213
+ "corr_nifty_20d",
214
+ "corr_nifty_60d",
215
+ "beta_nifty_60d",
216
+ "is_high_beta",
217
+ "is_low_beta",
218
+ "corr_breakdown",
219
+ "rel_strength_5d",
220
+ "rel_strength_20d",
221
+ "corr_gold_60d",
222
+ "corr_gold_rising",
223
+ "corr_brent_60d",
224
+ "corr_brent_rising",
225
+ "corr_usd_inr_60d",
226
+ "corr_usd_inr_rising",
227
+ "corr_us_60d"
228
+ ],
229
+ "total_features": 221,
230
+ "best_iteration": 1999,
231
+ "params": {
232
+ "objective": "binary:logistic",
233
+ "eval_metric": "aucpr",
234
+ "tree_method": "hist",
235
+ "device": "cuda",
236
+ "learning_rate": 0.02,
237
+ "max_depth": 6,
238
+ "subsample": 0.75,
239
+ "colsample_bytree": 0.75,
240
+ "min_child_weight": 20,
241
+ "gamma": 0.1,
242
+ "reg_alpha": 0.1,
243
+ "reg_lambda": 1.0,
244
+ "seed": 42,
245
+ "max_bin": 256,
246
+ "n_estimators": 2000
247
+ },
248
+ "metrics": {
249
+ "val": {
250
+ "pr_auc": 0.9042,
251
+ "roc_auc": 0.9472,
252
+ "precision": 0.7981,
253
+ "recall": 0.8364,
254
+ "ic": 0.714,
255
+ "n_rows": 1698058,
256
+ "pos_rate": 0.3062,
257
+ "brier_score": 0.0835,
258
+ "brier_skill_score": 0.6068000197410583,
259
+ "mean_calib_error": 0.0749,
260
+ "no_skill_brier": 0.21240000426769257,
261
+ "calibration_curve": {
262
+ "fraction_of_positives": [
263
+ 0.015583287674426738,
264
+ 0.07435920568570255,
265
+ 0.14871492862667884,
266
+ 0.236217017491847,
267
+ 0.32711561210652357,
268
+ 0.42616482259908844,
269
+ 0.5483246365396607,
270
+ 0.6818195209616121,
271
+ 0.821664709208752,
272
+ 0.966290848301184
273
+ ],
274
+ "mean_predicted_prob": [
275
+ 0.03545770506861525,
276
+ 0.1437372801748982,
277
+ 0.24671069988005753,
278
+ 0.34814692895842914,
279
+ 0.4489718037772851,
280
+ 0.5493239582662961,
281
+ 0.6504352846764856,
282
+ 0.751485701542276,
283
+ 0.85354191677695,
284
+ 0.9652750704686287
285
+ ]
286
+ }
287
+ },
288
+ "test_wf": {
289
+ "folds": [
290
+ {
291
+ "fold": 1,
292
+ "start": "2024-09-01",
293
+ "end": "2025-02-28",
294
+ "pr_auc": 0.9336,
295
+ "ic": 0.7619,
296
+ "brier": 0.085,
297
+ "n_rows": 262062,
298
+ "pos_rate": 0.386
299
+ },
300
+ {
301
+ "fold": 2,
302
+ "start": "2025-03-01",
303
+ "end": "2025-08-31",
304
+ "pr_auc": 0.8987,
305
+ "ic": 0.7044,
306
+ "brier": 0.0829,
307
+ "n_rows": 266786,
308
+ "pos_rate": 0.3005
309
+ },
310
+ {
311
+ "fold": 3,
312
+ "start": "2025-09-01",
313
+ "end": "2026-02-28",
314
+ "pr_auc": 0.8921,
315
+ "ic": 0.7011,
316
+ "brier": 0.0845,
317
+ "n_rows": 282585,
318
+ "pos_rate": 0.3007
319
+ },
320
+ {
321
+ "fold": 4,
322
+ "start": "2026-03-01",
323
+ "end": "2026-06-30",
324
+ "pr_auc": 0.8962,
325
+ "ic": 0.7157,
326
+ "brier": 0.0925,
327
+ "n_rows": 180837,
328
+ "pos_rate": 0.3352
329
+ }
330
+ ],
331
+ "mean_pr_auc": 0.9052,
332
+ "mean_ic": 0.7208,
333
+ "mean_brier": 0.0862
334
+ }
335
+ },
336
+ "class_balance": {
337
+ "total": 4231195,
338
+ "positive": 1701894,
339
+ "negative": 2529301,
340
+ "pos_rate": 0.4022,
341
+ "neg_rate": 0.5978,
342
+ "spw": 1.4862
343
+ },
344
+ "dataset": "/run/media/lucifer/developer/Developer/stock_model/Dataset/Processed_dataset/labeled_dataset_ml/ml_training_dataset_3.0pct_5days.parquet",
345
+ "run_dir": "/run/media/lucifer/developer/Developer/stock_model/models/runs/20260809_095516"
346
+ }
versions/20260809_095516/terminal_output.md ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ python train_model.py
3
+ ══════════════════════════════════════════════════════════════════════
4
+ XGBoost β€” Indian Stock Market Prediction
5
+ Dataset : ml_training_dataset_3.0pct_5days.parquet
6
+ Model : /run/media/lucifer/developer/Developer/stock_model/models
7
+ Chunk : 50,000 rows/chunk (~30MB per chunk)
8
+ ══════════════════════════════════════════════════════════════════════
9
+
10
+ ════ Device ══════════════════════════════════════════════════════════
11
+ βœ… CUDA available β€” training on GPU
12
+
13
+ ════ Splits ══════════════════════════════════════════════════════════
14
+ Total trading days : 5431
15
+ Train : 2008-09-02 00:00:00 β†’ 2021-02-15 00:00:00 (3801d, 70%)
16
+ Val : next β†’ 2024-08-30 00:00:00 (1086d, 20%)
17
+ Test : next β†’ 2026-06-30 00:00:00 (544d, 10%)
18
+
19
+ ════ Schema ══════════════════════════════════════════════════════════
20
+ Feature columns : 221
21
+
22
+ ════ Dataset audit ═══════════════════════════════════════════════════
23
+ Rows : 6,921,523
24
+ Symbols : 2,656
25
+ Dates : 2008-09-02 00:00:00 β†’ 2026-06-30 00:00:00
26
+ Pos : 2,548,741 (36.8%)
27
+ Neg : 4,372,782 (63.2%)
28
+
29
+ Run dir : runs/20260809_095516
30
+
31
+ ════ Model check ═════════════════════════════════════════════════════
32
+ ℹ️ No model found β†’ TRAIN FROM SCRATCH
33
+
34
+ ════ Class balance ═══════════════════════════════════════════════════
35
+ pos=1,701,894 neg=2,529,301 pos_rate=40.2% spw=1.49
36
+
37
+ ════ Building train DMatrix (chunked) ════════════════════════════════
38
+ Loaded 1,000,000 rows (20 chunks)...
39
+ Loaded 2,000,000 rows (40 chunks)...
40
+ Loaded 3,000,000 rows (60 chunks)...
41
+ Loaded 4,000,000 rows (80 chunks)...
42
+ Streamed 4,231,195 rows in 85 chunks (50000 rows/chunk)
43
+ DMatrix: 4,231,195 rows Γ— 221 features
44
+
45
+ ════ Building val DMatrix (chunked) ══════════════════════════════════
46
+ Loaded 1,000,000 rows (20 chunks)...
47
+ Streamed 1,698,058 rows in 34 chunks (50000 rows/chunk)
48
+ DMatrix: 1,698,058 rows Γ— 221 features
49
+
50
+ ════ Training ════════════════════════════════════════════════════════
51
+ [0] val-aucpr:0.87528
52
+ [100] val-aucpr:0.89288
53
+ [200] val-aucpr:0.89757
54
+ [300] val-aucpr:0.89873
55
+ [400] val-aucpr:0.89987
56
+ [500] val-aucpr:0.90073
57
+ [600] val-aucpr:0.90138
58
+ [700] val-aucpr:0.90167
59
+ [800] val-aucpr:0.90207
60
+ [900] val-aucpr:0.90227
61
+ [1000] val-aucpr:0.90252
62
+ [1100] val-aucpr:0.90273
63
+ [1200] val-aucpr:0.90298
64
+ [1300] val-aucpr:0.90316
65
+ [1400] val-aucpr:0.90333
66
+ [1500] val-aucpr:0.90351
67
+ [1600] val-aucpr:0.90363
68
+ [1700] val-aucpr:0.90377
69
+ [1800] val-aucpr:0.90390
70
+ [1900] val-aucpr:0.90403
71
+ [1999] val-aucpr:0.90422
72
+
73
+ Best iter : 1999 | Best score : 0.9042
74
+
75
+ ════ Validation evaluation (chunked inference) ═══════════════════════
76
+
77
+ [VAL] PR-AUC=0.9042 ROC-AUC=0.9472 Prec=0.7981 Rec=0.8364 IC=0.7140 n=1,698,058
78
+
79
+ Decile hit-rate (D10=highest confidence):
80
+ decile hit_rate count
81
+ D1 0.004 169806
82
+ D2 0.009 169806
83
+ D3 0.017 169806
84
+ D4 0.031 169805
85
+ D5 0.066 169806
86
+ D6 0.146 169806
87
+ D7 0.311 169805
88
+ D8 0.605 169806
89
+ D9 0.888 169806
90
+ D10 0.984 169806
91
+
92
+ βœ… IC strong (IC=0.7140)
93
+ Brier=0.0835 skill=0.6068 MCE=0.0749
94
+ Saved β†’ val_predictions.parquet
95
+
96
+ ════ Walk-forward test evaluation ════════════════════════════════════
97
+
98
+ Walk-forward test: 4 folds Γ— 6 months each
99
+ Fold 1 (2024-09-01 β†’ 2025-02-28): PR-AUC=0.9336 IC=0.7619 Brier=0.0850 n=262,062
100
+ Fold 2 (2025-03-01 β†’ 2025-08-31): PR-AUC=0.8987 IC=0.7044 Brier=0.0829 n=266,786
101
+ Fold 3 (2025-09-01 β†’ 2026-02-28): PR-AUC=0.8921 IC=0.7011 Brier=0.0845 n=282,585
102
+ Fold 4 (2026-03-01 β†’ 2026-06-30): PR-AUC=0.8962 IC=0.7157 Brier=0.0925 n=180,837
103
+ WF predictions β†’ test_wf_predictions.parquet
104
+
105
+ IC stability: min=0.7011 max=0.7619 mean=0.7208
106
+ ⚠️ IC range > 0.05 β€” model is regime-sensitive
107
+
108
+ ════ Saving ══════════════════════════════════════════════════════════
109
+ Phase 1 βœ“ β†’ runs/20260809_095516/
110
+ Phase 2 βœ“ β†’ xgb_model.json, model_metadata.json
111
+ ══════════════════════════════════════════════════════════════════════
112
+ βœ… DONE
113
+
114
+ Stable files:
115
+ feature_importance.csv 9.1 KB
116
+ model_metadata.json 7.8 KB
117
+ xgb_model.json 14750.7 KB
118
+
119
+ Run files (20260809_095516):
120
+ calibration.json 0.8 KB
121
+ run_metadata.json 7.8 KB
122
+ test_wf_predictions.parquet 7002.0 KB
123
+ val_predictions.parquet 10823.4 KB
124
+ ══════════════════════════════════════════════════════════════════════
versions/20260809_095516/test_wf_predictions.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c64d99b9435c35dbbe3675fbb01271aa991ea91cc56b1e5ae1839e494acd984d
3
+ size 7170046
versions/20260809_095516/val_predictions.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:773f16e3763716a3f0da8bd3d1b0b5d08211e1b584f64f556edb6f00bdefd4c2
3
+ size 11083146
xgb_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b97c1d15c8924fff752cd318eac6feb641ab4368b4d5f780ad2902bebfdad77
3
+ size 15104678