This project analyzes the Auto MPG dataset using linear regression techniques to predict fuel economy (miles per gallon) based on various vehicle characteristics. The analysis explores relationships between fuel efficiency and factors such as weight, horsepower, number of cylinders, and other automotive features.
The project uses the Auto MPG dataset which contains information about various car models and their fuel efficiency metrics.
- mpg: Miles per gallon (target variable)
- cylinders: Number of cylinders in the engine
- displacement: Engine displacement
- horsepower: Engine horsepower
- weight: Vehicle weight
- acceleration: Time to accelerate from 0-60 mph
- model year: Year the car was manufactured
- origin: Country of origin (1: USA, 2: Europe, 3: Asia)
- car name: Name of the car model
Fuel_Economy_LinRegression/
├── auto-mpg.ipynb # Main Jupyter notebook with analysis
├── Data/
│ └── auto-mpg.csv # Dataset file
├── anaconda_projects/ # Anaconda project configuration
└── README.md # This file
To run this project, you'll need the following Python libraries:
- pandas
- numpy
- seaborn
- matplotlib (likely used for visualizations)
- scikit-learn (for linear regression models)
- Clone or download this repository
- Install required dependencies:
pip install pandas numpy seaborn matplotlib scikit-learn
- Open the Jupyter notebook:
jupyter notebook auto-mpg.ipynb
The notebook includes:
-
Data Exploration and Preprocessing
- Loading and examining the dataset structure
- Handling missing values (particularly in the horsepower column)
- Converting categorical variables to appropriate data types
- Data cleaning and preparation
-
Exploratory Data Analysis
- Statistical summaries of the data
- Visualization of relationships between variables
- Correlation analysis
-
Linear Regression Modeling
- Building predictive models for fuel economy
- Feature selection and engineering
- Model evaluation and performance metrics
-
Results and Insights
- Model performance analysis
- Key factors affecting fuel economy
- Conclusions and recommendations
The analysis reveals important relationships between vehicle characteristics and fuel economy, providing insights into factors that most significantly impact miles per gallon performance.
- Open the
auto-mpg.ipynbnotebook in Jupyter - Run cells sequentially to reproduce the analysis
- Modify parameters or add new features as needed
- The dataset is automatically loaded from the
Data/directory
The Auto MPG dataset is a classic machine learning dataset commonly used for regression analysis and is available from the UCI Machine Learning Repository.
Feel free to fork this project and submit pull requests for improvements or additional analysis.
This project is for educational and research purposes.