-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathresult_ml.txt
More file actions
137 lines (112 loc) · 4.69 KB
/
Copy pathresult_ml.txt
File metadata and controls
137 lines (112 loc) · 4.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
======================================================================
Stage 3 · LightGBM Alpha Synthesis
======================================================================
1. Loading factors_clean.parquet and prices.parquet ...
factors shape : (364200, 16)
prices shape : (361333, 9)
2. Computing 1-day forward returns ...
3. Merging factors and target labels ...
merged shape : (357978, 18)
feature cols : ['alpha001', 'alpha003', 'alpha006', 'alpha012', 'alpha038', 'alpha040', 'alpha041', 'alpha042', 'alpha072', 'alpha088', 'alpha094', 'alpha098', 'alpha101', 'alpha_5_day_reversal']
training target : cs_rank_return (cross-sectional pct-rank of forward_return, per trade_date)
======================================================================
Walk-Forward Training
======================================================================
Settings : train=16m val=4m test=4m embargo=1d
Estimated folds : 9
--- Fold 1 ---
Train : 20190102 → 20200522 (n=99,349)
Val : 20200525 → 20200921 (n=24,609)
Test : 20200923 → 20210127 (n=24,768)
Best iteration : 519
--- Fold 2 ---
Train : 20190513 → 20200921 (n=99,263)
Val : 20200922 → 20210126 (n=24,768)
Test : 20210128 → 20210607 (n=24,719)
Best iteration : 420
--- Fold 3 ---
Train : 20190909 → 20210126 (n=99,030)
Val : 20210127 → 20210604 (n=24,716)
Test : 20210608 → 20211013 (n=24,648)
Best iteration : 142
--- Fold 4 ---
Train : 20200114 → 20210604 (n=98,769)
Val : 20210607 → 20211012 (n=24,648)
Test : 20211014 → 20220216 (n=24,847)
Best iteration : 142
--- Fold 5 ---
Train : 20200525 → 20211012 (n=98,741)
Val : 20211013 → 20220215 (n=24,846)
Test : 20220217 → 20220622 (n=24,757)
Best iteration : 486
--- Fold 6 ---
Train : 20200922 → 20220215 (n=98,978)
Val : 20220216 → 20220621 (n=24,761)
Test : 20220623 → 20221026 (n=24,890)
Best iteration : 190
--- Fold 7 ---
Train : 20210127 → 20220621 (n=98,971)
Val : 20220622 → 20221025 (n=24,888)
Test : 20221027 → 20230301 (n=24,854)
Best iteration : 224
--- Fold 8 ---
Train : 20210607 → 20221025 (n=99,143)
Val : 20221026 → 20230228 (n=24,854)
Test : 20230302 → 20230705 (n=24,831)
Best iteration : 288
--- Fold 9 ---
Train : 20211013 → 20230228 (n=99,349)
Val : 20230301 → 20230704 (n=24,830)
Test : 20230706 → 20231108 (n=24,771)
Best iteration : 595
======================================================================
Assembling Final ML Alpha
======================================================================
final_alpha_df shape : (223085, 3) (after 3-day smoothing)
date range : 20200923 → 20231108
======================================================================
IC Analysis — ML Synthetic Factor
======================================================================
IC Mean : +0.0439
IC Std : 0.0982
ICIR : +0.4472
IC chart saved: plots/ml_alpha_ic.png
======================================================================
Layered Backtest (LayeredBacktester)
======================================================================
Layered Backtest Performance:
Cum Return Ann Return Ann Vol Sharpe Max DD
G1 -0.4827 -0.1973 0.1607 -1.4144 -0.5220
G2 -0.1957 -0.0700 0.1667 -0.5998 -0.2693
G3 -0.0285 -0.0096 0.1655 -0.2392 -0.2371
G4 0.0623 0.0204 0.1688 -0.0572 -0.2455
G5 0.3644 0.1091 0.1761 0.4494 -0.2235
L-S 1.6169 0.3780 0.0995 3.4989 -0.1010
======================================================================
Feature Importance (Average Across Folds)
======================================================================
Average Feature Importance (gain):
feature importance
alpha038 5253.301237
alpha042 4729.082828
alpha101 4277.963360
alpha_5_day_reversal 3741.844163
alpha041 3518.533852
alpha001 3372.430376
alpha094 3271.414493
alpha012 3113.814430
alpha040 2471.851905
alpha088 2467.149983
alpha006 2359.141435
alpha072 2342.694817
alpha003 2294.295588
alpha098 2096.524049
Saved: plots/feature_importance.png
======================================================================
SHAP Analysis (Last Fold Test Sample)
======================================================================
SHAP sample size : 300 rows
Saved: plots/shap_beeswarm.png
======================================================================
Report Written
======================================================================