Market regimeΒΆ
Unsupervised market-regime labelling by clustering rolling volatility / return
features. detect_regimes is the in-sample
convenience (for analysis); RegimeDetector is
the causal fit-on-train / assign-online variant for backtests.
|
Label market regimes by k-means on rolling vol / return features. |
|
Build the causal regime feature matrix: trailing vol and mean return. |
|
Causal market-regime detector (fit on the past, assign online). |