Challenge

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

FeatureDescription
mpgMiles per gallon (fuel efficiency)
cylindersNumber of engine cylinders
displacementEngine displacement
horsepowerHorsepower (requires cleaning)
weightVehicle weight
accelerationTime taken to accelerate
yearModel year
originOrigin (1 = USA, 2 = Europe, 3 = Japan)
nameCar name


🧹 Data Cleaning Summary

  • Converted horsepower from object to numeric using pd.to_numeric(errors='coerce')

  • Removed 5 rows containing missing horsepower values (?)

  • Ensured correct data types across all columns

  • Mapped numeric origin codes to readable labels: "USA", "Europe", "Japan"

βœ… Final dataset shape: 392 rows Γ— 9 columns


πŸ“Š Descriptive Analytics

🚘 Summary Statistics

python
df.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:

  1. Year

  2. Weight

  3. Horsepower

  4. 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.


Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.