Skip to content

TheIbrahimMalik/bike-sharing-demand-autogluon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Bike Sharing Demand Prediction using AutoGluon

Author: Ibrahim Malik

This project builds a machine learning model to predict hourly bike rental demand using the Kaggle Bike Sharing Demand dataset. The objective is to minimise prediction error (RMSLE) using automated model selection, feature engineering, and hyperparameter optimisation.

Problem Overview

Accurately forecasting bike rental demand enables better operational planning and resource allocation. The dataset contains hourly records of bike rentals along with weather, seasonal, and calendar-related features.

The goal is to predict the count of bike rentals for unseen test data.

Approach

The project was completed in three main stages:

1️⃣ Baseline Model

  • Used AutoGluon TabularPredictor with default settings
  • Evaluation metric: RMSE (local) and RMSLE (Kaggle)
  • Best local RMSE: 53.01
  • Kaggle RMSLE: 1.80

2️⃣ Feature Engineering

  • Extracted hour, day, month, and year from datetime
  • Performed exploratory data analysis
  • Improved model performance significantly

Results:

  • Local RMSE: 37.44
  • Kaggle RMSLE: 0.48

3️⃣ Hyperparameter Optimisation

  • Tuned:
    • num_stack_levels
    • num_bag_folds
    • time_limit
    • num_trials
  • Applied custom hyperparameter configurations for RF, GBM, and XGBoost

Final Results:

  • Local RMSE: 41.21
  • Kaggle RMSLE: 0.46

The best-performing model across experiments was a WeightedEnsemble_L3.

Repository Structure

bike-sharing-demand-autogluon/
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ sampleSubmission.csv
β”‚   β”œβ”€β”€ test.csv
β”‚   └── train.csv
β”œβ”€β”€ figures/
β”‚   β”œβ”€β”€ model_test_score.png
β”‚   β”œβ”€β”€ model_train_score.png
β”‚   β”œβ”€β”€ sagemaker-studio-git1.png
β”‚   └── sagemaker-studio-git2.png
β”œβ”€β”€ notebooks/
β”‚   └── bike_sharing_demand_autogluon.ipynb  # Main development notebook
β”œβ”€β”€ submissions/
β”‚   β”œβ”€β”€ baseline_predictions.csv
β”‚   β”œβ”€β”€ feature_engineered_predictions.csv
β”‚   └── hpo_predictions.csv
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ REPORT.md
└── requirements.txt

Reproducibility

Install dependencies:

pip install -r requirements.txt

Open the notebook:

jupyter lab

Run all cells in:

notebooks/bike_sharing_demand_autogluon.ipynb

Key Takeaways

  • Feature engineering had the largest impact on model performance.
  • Ensemble stacking improved the Kaggle score despite slight local metric degradation.
  • Additional compute and deeper stacking could further improve performance.

Attribution

Originally completed as part of the Udacity AWS Machine Learning Engineer Nanodegree. Refactored and documented for portfolio presentation.

About

🚴 Predict hourly bike-sharing demand using AutoGluon. Features an iterative ML workflow: baseline modeling, custom feature engineering, and hyperparameter optimisation to minimise RMSLE.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors