Skip to content

feat: ENEL time-series forecasting pipeline with walk-forward validation - #12

Draft
MCCdvd with Copilot wants to merge 4 commits into
mainfrom
copilot/implement-forecasting-pipeline
Draft

feat: ENEL time-series forecasting pipeline with walk-forward validation#12
MCCdvd with Copilot wants to merge 4 commits into
mainfrom
copilot/implement-forecasting-pipeline

Conversation

Copilot AI commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Adds a reproducible ML forecasting pipeline for the ENEL daily stock dataset, comparing multiple models under strict walk-forward validation (no leakage).

Pipeline (enel/enel_forecast.py)

  • Data loading: locale-aware parsing (Italian format: 1.234,561234.56), date sorting
  • Feature engineering: Close/return lags 1–10, volume lags 1–5, rolling mean/std (windows 5/10/20), existing technicals (MACD, RSI, MAs, etc.); all features at t predict t+1
  • Targets: next-day Close price (regression) and next-day direction Up/Down (classification)
  • Validation: TimeSeriesSplit walk-forward (default 5 folds); scaler fit per fold to prevent leakage
  • Models: Naive baseline, ARIMA(2,1,2), RandomForest, LightGBM — both regression and classification
  • Outputs: prints best-model recommendation to console; saves full comparison to reports/enel_model_comparison.csv
pip install -r enel/requirements_enel.txt
# place dataset at enel/ENEL.csv then:
python enel/enel_forecast.py [--data PATH] [--splits N] [--skip-arima]

ARIMA is auto-skipped for datasets > 1000 rows (too slow for per-step re-fitting); --skip-arima forces skip.

Other changes

  • enel/requirements_enel.txt: pinned deps (pandas, scikit-learn, lightgbm, statsmodels)
  • .gitignore: excludes enel/ENEL.csv (user-provided, not committed)
  • README.md: added ENEL forecasting section with dataset format, assumptions, and usage

Co-authored-by: MCCdvd <157378826+MCCdvd@users.noreply.github.com>
Copilot AI changed the title [WIP] Add forecasting pipeline for ENEL time-series dataset feat: ENEL time-series forecasting pipeline with walk-forward validation Aug 29, 2026
Copilot AI requested a review from MCCdvd August 29, 2026 06:14
Co-authored-by: MCCdvd <157378826+MCCdvd@users.noreply.github.com>
Co-authored-by: MCCdvd <157378826+MCCdvd@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants