Skip to content

Latest commit

 

History

History
100 lines (74 loc) · 2.84 KB

File metadata and controls

100 lines (74 loc) · 2.84 KB

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.