GitHunt
RI

ritesh-begin/Traffic_prediction

This is the Traffic Analysis and Prediction based project from RandomForest Classifier.

๐Ÿšฆ Traffic Data Analysis & Prediction

๐Ÿ“Œ Introduction

This project focuses on analyzing traffic data collected over a span of two months. Using data visualization and machine learning models, the goal is to uncover traffic patterns and build predictive models to better understand situation and traffic density.

๐ŸŽฏ Objectives

  • Perform exploratory data analysis (EDA) on traffic data.
  • Visualize patterns with Matplotlib, Seaborn, and Plotly.
  • Apply feature preprocessing (scaling, encoding).
  • Train regression models (RandomForest Classifier) to predict traffic values.
  • Evaluate model performance with accuracy_score metrics.

๐Ÿ“‚ Dataset

  • File Used: TrafficTwoMonth.csv
  • The dataset contains traffic-related information including:
    • Hourly data
    • Vehicle counts (car, bus, truck, bike and total)
    • Traffic situation categories
    • Other feature like Time of that particular date is present.

๐Ÿ› ๏ธ Tools & Libraries

  • Python
  • Pandas & NumPy โ†’ Data manipulation & analysis
  • Matplotlib & Seaborn โ†’ Normal visualizations
  • Plotly โ†’ Interactive visualizations
  • Scikit-learn โ†’ Data preprocessing, RandomForest Classifier, pipelines , ColumnTransformer

๐Ÿ”Ž Exploratory Data Analysis

  • Initial data inspection (head(), info(), describe())
  • Traffic trend analysis across different hours and dates
  • Distribution plots for vehicle counts
  • Interactive plots for comparative analysis

๐Ÿ“Š Visualizations

  • Traffic patterns per weekend
  • Count comparisons between different vehicle types per Hour
  • Interactive hist plot for vehicles per hour for week days
  • Line plot for average vehicle per hour
  • Visualizations combining total trafffic by category
  • Line plot for average vehicle accordance with the date of the month

๐Ÿค– Machine Learning Models

  • Preprocessing:

    • Standard scaling
    • One-hot encoding for categorical features
  • Models Used:

    • Random Forest Classifier
  • Evaluation:

    • Accuracy_score
    • Classification_report

๐Ÿ“ˆ Results

  • RandomForest Classifier models provide an estimation of traffic levels.
  • Visualization highlights peak hours and traffic conditions.
ritesh-begin/Traffic_prediction | GitHunt