Skip to content

Mileage Prediction - Regression Analysis πŸš— This project predicts vehicle mileage (MPG) using Linear Regression. It preprocesses data, visualizes feature relationships, and achieves an RΒ² score of 70.3%. πŸš€ πŸ”Ή Key Features: Data cleaning, visualization, and model training. πŸ“Š Performance: MAE: 3.33 | MAPE: 14.7% | RΒ²: 70.3% πŸ“Œ MIT License

Notifications You must be signed in to change notification settings

Gani077/YBI_PY_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MILEAGE PREDICTION - REGRESSION ANALYSIS

Objective

The project aims to predict city-cycle fuel consumption (miles per gallon) using regression analysis. The dataset contains a mix of categorical and continuous attributes, which influence fuel efficiency.

Data Source

The dataset is sourced from the YBI Foundation.

Dataset Information

The dataset consists of 398 entries and 9 attributes:

  • mpg: Miles per gallon (target variable)
  • cylinders: Number of engine cylinders
  • displacement: Engine displacement
  • horsepower: Engine power output
  • weight: Vehicle weight
  • acceleration: Acceleration capability
  • model_year: Year of the vehicle model
  • origin: Manufacturing origin
  • name: Vehicle name/model

Data Preprocessing

  • Checked for missing values and removed them
  • Standardized numerical features using StandardScaler

Data Visualization

  • Pairplot and regression plots were generated using Seaborn to visualize relationships between features

Model Training

  • Features (X): ['displacement', 'horsepower', 'weight', 'acceleration']
  • Target (y): mpg
  • Train-test split: 70% training, 30% testing
  • Model: Linear Regression

Model Performance

Metrics calculated on test data:

  • Mean Absolute Error (MAE): 3.33
  • Mean Absolute Percentage Error (MAPE): 14.7%
  • R-squared Score: 70.3%

Dependencies

Install the required libraries using:

pip install pandas numpy matplotlib seaborn scikit-learn

Running the Project

  1. Clone the repository:
git clone <repository-url>
  1. Run the script:
python mileage_prediction.py

Conclusion

The Linear Regression model achieved an R-squared score of 70.3%, meaning it explains 70% of the variance in mileage prediction. Further improvements can be made by feature engineering, adding more attributes, or using advanced regression techniques.

License

This project is open-source under the MIT License.

About

Mileage Prediction - Regression Analysis πŸš— This project predicts vehicle mileage (MPG) using Linear Regression. It preprocesses data, visualizes feature relationships, and achieves an RΒ² score of 70.3%. πŸš€ πŸ”Ή Key Features: Data cleaning, visualization, and model training. πŸ“Š Performance: MAE: 3.33 | MAPE: 14.7% | RΒ²: 70.3% πŸ“Œ MIT License

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published