A progressively-scaled next-day price forecasting study: data extraction, then time-series concepts (decomposition, ADF stationarity), then classical models (ARIMA, Holt, Prophet), then ML regressors (Linear, Ridge, Random Forest, XGBoost, Gradient Boosting) on one stock.
Validated across 10 random stocks, then scaled to the full eligible Nifty 500 universe — with every model checked against a naive "tomorrow = today" persistence baseline at every scale.
Key finding
Tree-based models were consistently and substantially worse than the naive baseline at predicting next-day price level — a caution against trusting MAPE in isolation without checking the "beats naive" rate.
Fixed in review
- A fabricated "no data leakage" validation that printed three hard-coded literal price predictions regardless of what the model actually produced — replaced with a real, live comparison against the naive baseline computed from that run's actual test data.
- A stray hard-coded result ("Linear Regression, 1.06% MAPE for RELIANCE") baked into two unrelated summary cells regardless of whether RELIANCE was even in that run's sample.
- A misleading seasonality check that flagged "present" for virtually any series including pure noise, replaced with a standard seasonal-strength measure.
- Manual Colab upload replaced with programmatic fetch; a matplotlib version-compatibility bug fixed; three duplicate feature-engineering functions consolidated into one.
ForecastingARIMAXGBoostBaseline testing