Skip to content

PhysicalAIEngineer/Smart-Mobility-Demand-Prediction-

Smart-Mobility-Demand-Prediction

End-to-end machine learning project for bike demand prediction using EDA, feature engineering, regression modeling, and validation. Includes business insights and data-driven strategies for optimizing fleet allocation, pricing, and operations based on weather, seasonality, and user behavior

πŸš΄β€β™‚οΈ Bike Sharing Demand Prediction & Business Insights

πŸ“Œ Overview

This project analyzes a bike-sharing dataset to understand demand patterns and build a predictive model using Linear Regression. The goal is to identify key factors influencing bike rentals and derive actionable business insights.


🎯 Objectives

  • Perform Exploratory Data Analysis (EDA)
  • Identify key factors affecting bike demand
  • Build a regression model to predict bike rentals (cnt)
  • Validate model assumptions
  • Generate business insights & strategies

πŸ“Š Dataset Description

The dataset contains daily bike rental data with features such as:

  • 🌑️ Temperature (temp, atemp)
  • πŸ’§ Humidity (hum)
  • πŸ’¨ Windspeed (windspeed)
  • 🌦️ Weather situation (weathersit)
  • πŸ“… Date, month, weekday
  • πŸ‘₯ Casual & registered users
  • 🎯 Target: Total rentals (cnt)

πŸ” Exploratory Data Analysis (EDA)

  • Distribution plots for numerical features
  • Boxplots for categorical variables vs demand
  • Correlation heatmap
  • Pairplot for feature relationships

Key Findings:

  • Temperature strongly influences demand
  • Bad weather reduces usage significantly
  • Demand varies across seasons and months

βš™οΈ Data Preprocessing

  • Converted categorical variables (month, weekday, weather)
  • Created dummy variables
  • Removed multicollinearity (temp, casual, registered)
  • Feature scaling using MinMaxScaler
  • Train-test split (70:30)

🧠 Feature Selection

  • Recursive Feature Elimination (RFE)
  • Statistical significance (p-values)
  • Variance Inflation Factor (VIF)

Final Features:

  • yr, atemp, windspeed, season_spring, mnth_Jul, weathersit_C

πŸ“ˆ Model Building

  • Linear Regression (Statsmodels & Sklearn)
  • Multiple models compared:
    • 15 features
    • 7 features
    • 6 features (final optimized)

πŸ“Š Model Performance

Model RΒ² Score Remarks
Full Model ~0.85 High complexity
Reduced Model ~0.81 Best balance
Final Model ~0.79 Simple & stable

πŸ” Model Diagnostics

  • Residual analysis β†’ approximately normal
  • Residual vs predicted β†’ slight heteroscedasticity
  • VIF β†’ low multicollinearity
  • Strong generalization on test data

πŸ“Š Visualizations

  • Distribution plots
  • Correlation heatmap
  • Residual plots
  • Actual vs Predicted scatter plot

πŸ’‘ Key Insights

πŸ”₯ Positive Drivers

  • Perceived temperature (atemp)
  • Year-over-year growth

❌ Negative Drivers

  • Humidity
  • Windspeed
  • Bad weather conditions

πŸ“… Seasonal Trends

  • High demand: Fall, moderate weather
  • Low demand: Spring, extreme summer

πŸš€ Business Strategy

1. Demand Forecasting

  • Use weather-based prediction models

2. Dynamic Pricing

  • Increase prices in high demand
  • Discounts in bad weather

3. Fleet Optimization

  • Allocate bikes based on demand patterns

4. Seasonal Campaigns

  • Boost demand in low seasons

5. Smart Operations

  • Schedule maintenance in low-demand periods

πŸ› οΈ Tech Stack

  • Python
  • Pandas, NumPy
  • Matplotlib, Seaborn
  • Scikit-learn
  • Statsmodels

πŸ“‚ Project Structure

β”œβ”€β”€ data.csv

β”œβ”€β”€ Smart_Mobility_Prediction.ipynb

β”œβ”€β”€ Data dictinonary.txt

β”œβ”€β”€ README.md


▢️ How to Run

git clone https://github.com/your-username/bike-demand-analysis.git
cd bike-demand-analysis
pip install -r requirements.txt
jupyter notebook

About

End-to-end machine learning project for bike demand prediction using EDA, feature engineering, regression modeling, and validation. Includes business insights and data-driven strategies for optimizing fleet allocation, pricing, and operations based on weather, seasonality, and user behavior

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors