Regime Classifier
With Claude Code’s help (in less than a day), I dusted off a regime classifier I originally wrote in Python back in 2018. This time Claude handled most of the HTML front end and helped refresh the data pipeline.
The model classifies risk regimes using a machine learning classifier (Gaussian Mixture Model or GMM) fit on the first principal component (PC1) of a panel of risk indicators, as a single ‘risk sentiment’ factor. The 2018 version also classified macroeconomic regimes, but that piece relied on data that isn’t freely available.
In my experience:
Real-time classification. Identifying a risk-off regime as it happens isn’t especially hard, since the market is usually already selling off by the time you’re asking the question. The model’s contribution here is cutting through media noise to confirm the signal with a rule-based read rather than a narrative one.
Back-testing other signals. The more useful application is historical. Because the model produces a consistent, rule-based set of regime dates, you can apply the same definition of risk-on and risk-off when evaluating other alpha signals, for example, asking how a given momentum or value signal performs across regimes.