Project 1
π Automobile Dataset (1985) Analysis β Project Report
π Objective
The purpose of this project is to perform data cleaning, exploratory data analysis (EDA), and basic machine learning modeling on the 1985 Automobile dataset. This analysis aims to uncover insights into vehicle fuel efficiency, engine performance, and trends based on region and model year.
π₯ Data Overview
-
Dataset: Automobile data from 1985
-
Total Entries: 397
-
Features: 9
| Feature | Description |
|---|---|
mpg | Miles per gallon (fuel efficiency) |
cylinders | Number of engine cylinders |
displacement | Engine displacement |
horsepower | Horsepower (requires cleaning) |
weight | Vehicle weight |
acceleration | Time taken to accelerate |
year | Model year |
origin | Origin (1 = USA, 2 = Europe, 3 = Japan) |
name | Car name |
π§Ή Data Cleaning Summary
-
Converted
horsepowerfrom object to numeric usingpd.to_numeric(errors='coerce') -
Removed 5 rows containing missing
horsepowervalues (?) -
Ensured correct data types across all columns
-
Mapped numeric
origincodes to readable labels:"USA","Europe","Japan"
β Final dataset shape: 392 rows Γ 9 columns
π Descriptive Analytics
π Summary Statistics
pythondf.describe()
Shows key metrics for numerical columns, including mean, min, max, and standard deviation.
π Trends Over Time
-
Average MPG has steadily increased from 1970 to 1982, indicating improved fuel efficiency standards.
π Regional Insights
-
USA: Cars have higher horsepower but lower MPG
-
Japan: Cars show higher MPG and lower horsepower, indicating efficiency
-
Europe: Balanced between power and efficiency
π Visual Insights
-
π Average MPG Over the Years β Fuel efficiency has improved over time
-
π₯ Average Horsepower by Origin β USA leads in engine power
-
π Average MPG by Origin β Japan leads in fuel efficiency
-
πΊοΈ Number of Cars by Region β USA has the highest number of entries
π€ Machine Learning β MPG Prediction
Model: Random Forest Regressor
Target: mpg
Features: cylinders, displacement, horsepower, weight, acceleration, year
β
Best Hyperparameters (via RandomizedSearchCV):
python{'n_estimators': 200, 'max_depth': 20, 'max_features': 'sqrt', 'min_samples_split': 5}
π Feature Importance
Top predictors of fuel efficiency:
-
Year
-
Weight
-
Horsepower
-
Displacement
π§ Key Insights
-
Newer cars are significantly more fuel efficient
-
Heavier cars tend to have lower MPG
-
Japanese cars are generally more fuel efficient
-
American cars prioritize power over efficiency
π Conclusion
The Automobile dataset offers valuable insights into fuel efficiency trends, regional design priorities, and how various specs affect performance. The Random Forest model accurately predicted MPG and helped highlight the most influential vehicle characteristics.