Skip to content

This repository contains a regression algorithm for predicting vehicle fuel efficiency (MPG) based on various features. The algorithm is deployed using Streamlit, providing an interactive interface for users to input vehicle details and get real-time MPG predictions. Start optimizing your fuel usage today! 🚗💨

License

Makorg123/Project1_MPG_Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Title: Mileage per Gallon (MPG) Prediction using Linear Regression

Description:

The Mileage per Gallon (MPG) Prediction project aims to develop a predictive model using linear regression to estimate the fuel efficiency of vehicles. MPG is a crucial metric for evaluating the performance and environmental impact of automobiles. By accurately predicting the MPG, we can provide valuable insights for manufacturers, consumers, and policymakers, enabling them to make informed decisions regarding vehicle purchases, emissions reduction, and fuel economy improvements.

To accomplish this, the project utilizes linear regression, a widely used statistical technique for modeling the relationship between variables. The model will be trained on a dataset consisting of various automotive features, such as engine displacement, horsepower, vehicle weight, and other relevant attributes. The target variable, in this case, is the MPG of the vehicle, which will be used to establish a linear relationship with the input features.

The project involves the following key steps:

Data Collection: Dataset: UCI Machine Learning Repository.
Data link: https://archive.ics.uci.edu/ml/datasets/auto+mpg

Data Preprocessing: Cleaning and preprocessing the dataset to handle missing values, outliers, and inconsistencies. This step also involves transforming categorical variables into numerical representations, normalizing numeric features, and splitting the dataset into training and testing subsets.

Model Training: Implementing linear regression using appropriate libraries or frameworks. The training process involves fitting the model to the training data, estimating the coefficients (slope and intercept), and optimizing the model's performance by minimizing the residual errors between the predicted and actual MPG values.

Model Evaluation: Assessing the performance of the trained linear regression model using evaluation metrics such as mean squared error (MSE), root mean squared error (RMSE), and R-squared. These metrics provide insights into how well the model predicts the MPG values and indicate its overall accuracy.

Prediction and Deployment: in this phase, I've used Streamlit for deploying the app. to predict the MPG values for vehicles not included in the training phase.

The Mileage per Gallon (MPG) Prediction project holds significant potential in assisting car manufacturers, consumers, and policymakers in making informed decisions related to fuel efficiency and environmental impact. The accurate estimation of MPG can contribute to the development of more fuel-efficient vehicles, reduce carbon emissions, and promote sustainable transportation choices.

Usage

Once the Streamlit application is running, you will be presented with a user interface containing input fields for various features. Enter the relevant details, such as the number of cylinders, horsepower, displacement, weight, modelyear etc., and click on the "Predict" button. The application will utilize the trained Linear Regression model to generate a predicted price for the miles based on the provided features.

Contributing

Contributions to this project are welcome. If you would like to contribute, please follow these steps:

Fork the repository on GitHub

  • 1)Create a new branch from the main branch to work on your changes.
  • 2)Make your modifications and commit your changes.
  • 3)Push your branch to your forked repository.
  • 4)Open a pull request to the original repository, describing the changes you made.

License

This project is licensed under the MIT License.

Acknowledgments

  • The dataset used in this project is sourced from: https://archive.ics.uci.edu/ml/datasets/auto+mpg
  • The Linear Regression algorithm is implemented using the scikit-learn library.
  • The Streamlit framework is used for creating the web application.

Contact

If you have any questions or suggestions regarding this project, please feel free to contact me at 132anaskhan@gmail.com.

Technology used:

Jupyter Vs code Streamlit
MPG_Prediction.mp4

About

This repository contains a regression algorithm for predicting vehicle fuel efficiency (MPG) based on various features. The algorithm is deployed using Streamlit, providing an interactive interface for users to input vehicle details and get real-time MPG predictions. Start optimizing your fuel usage today! 🚗💨

Topics

Resources

License

Stars

Watchers

Forks

Languages