This repository trains an outlier-resistant gradient-boosted regression model, generates the 12,000 required predictions, and creates the fixed December chart.
data/
train_test.csv
validation.csv
validation_predictions_template.csv
december_chart_inputs.csv
train_predict.py
score.py
requirements.txt
outputs/
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
python -m pip install -r requirements.txt
python train_predict.py
python score.py \
--predictions outputs/validation_predictions.csv \
--december-predictions outputs/december_chart_inputs.csv \
--output-dir outputs/scorer_resultsThe first command writes:
outputs/validation_predictions.csvoutputs/december_chart_inputs.csvoutputs/validation_metrics.json
The scorer validates both CSV files and creates
outputs/scorer_results/candidate_december.png.
Because the labeled observations cover January through October 2025 and the unlabeled observations are later in time, validation is chronological: January-September is used for training and October is held out. This is more representative than a random split and prevents future observations from informing earlier predictions.
- Dates are represented by an ordinal trend plus cyclical weekday/year terms.
- Distance curvature and absolute weight are added as engineered features.
- Missing numeric values are median-imputed with missingness indicators.
- Unknown cities are safely ignored by the one-hot encoder; latitude and longitude still provide geographic information.
- Implausible weights are treated as missing.
- A robust absolute-error model identifies the largest 1.5% of target residuals. A regularized histogram gradient-boosting model is then fitted to the remaining data so isolated label spikes do not distort typical predictions.
- All final predictions are constrained to be positive.
No information from load_id is used as a model feature.