Short-term market-regime classification experiment
This project frames S&P 500 behavior as a three-class classification problem and tests whether technical indicators can predict next-day market regimes.
Challenge
- Short-horizon financial classification is noisy and often dominated by majority classes.
- A model may produce acceptable accuracy while failing to separate Bullish and Bearish regimes.
- Time-series validation is needed to avoid misleading evaluation.
System architecture
Data and inputs
S&P 500 index data from 2020-01-01 to 2024-01-01 with daily return, SMA_20, SMA_50, and 20-day rolling volatility features.
Technical approach
- Label next-day returns as Bullish, Sideways, or Bearish using ±0.5% thresholds.
- Compare Logistic Regression, Random Forest, and SVM.
- Use tuned versions with time-series-aware validation.
- Interpret both accuracy and balanced accuracy.
Evaluation and results
956 modeling observations
3 market regimes
Best accuracy 52.08%
- The best accuracy was about 52.08%, while balanced accuracy stayed near one-third.
- Models leaned toward the majority Sideways regime.
- The result shows that simple indicators may structure analysis but remain weak for next-day regime prediction.
Implementation and code
Implementation focus
The implementation connects data preparation, modeling, evaluation, and interpretation in a structured workflow that makes the technical decisions clear.
Source code
The code is available for exploring the implementation details and extending the experiment when needed.
Scope and responsible use
The analysis is intended for modeling and evaluation, not investment advice. Real trading use would require risk controls, transaction-cost modeling, out-of-sample validation, and continuous monitoring.
Future development
- Add richer macro and volatility features.
- Test longer horizons and different labeling thresholds.
- Use probability calibration and uncertainty-aware reporting.
Technical contribution
The project shows disciplined interpretation of weak financial ML signals instead of overstating noisy classification results.