This project aims to predict car prices using a linear regression model trained on the Car Price Prediction Dataset.
- Source: Kaggle – Car Price Prediction Dataset
- Features: "CarName" (dummy), "fueltype", "aspiration", "doornumber", "carbody" (dummy), "drivewheel" (dummy), "enginesize", "horsepower", "citympg", "highwaympg", etc.
- Target variable:
price
Python 3.10+ is recommended to run this project.
# Create virtual environment (optional but recommended)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install required packages
pip install -r requirements.txtAfter training the linear regression model, the following results were obtained:
- Intercept: 13223.41
- Coefficients: [330.45, 403.46, 345.89, 2522.73, -18.31, 1726.32, ...]
(only showing a subset for readability) - Mean Squared Error (MSE): 9,972,068.10
- R² (Coefficient of Determination): 0.87
| Metric | Value |
|---|---|
| Intercept | 13223.41 |
| MSE | 9,972,068.10 |
| R² | 0.87 |
The plot below shows predicted vs. actual car prices:
This project is licensed under the MIT License - see the LICENSE file for details.
Run the project by simply executing:
python main.py