Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freight Rate Prediction Challenge

This repository trains an outlier-resistant gradient-boosted regression model, generates the 12,000 required predictions, and creates the fixed December chart.

Project structure

data/
  train_test.csv
  validation.csv
  validation_predictions_template.csv
  december_chart_inputs.csv
train_predict.py
score.py
requirements.txt
outputs/

Setup and run

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_results

The first command writes:

  • outputs/validation_predictions.csv
  • outputs/december_chart_inputs.csv
  • outputs/validation_metrics.json

The scorer validates both CSV files and creates outputs/scorer_results/candidate_december.png.

Validation design

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.

Modeling decisions

  • 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.

About

Machine learning solution for predicting freight rates using chronological validation, feature engineering, robust outlier handling, and gradient boosting.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages