This project aims to predict the price of a car based on its features such as make, model, year, mileage, and other relevant factors using regression analysis.
The dataset used in this project contains information about car sales from a dealership. It includes the following columns:
Make: Make of the car (categorical)Model: Model of the car (categorical)Year: Year of the car (numerical)Mileage: Mileage of the car (numerical)Color: Color of the car (categorical)Price: Sale price of the car (numerical)
- Python 3.6 or higher
- scikit-learn
- pandas
- matplotlib
- Clone this repository:
<pre>
git clone https://github.com/<username>/car-purchase-prediction.git
</pre>
<li>Install the required packages:</li>
<pre>
pip install scikit-learn pandas matplotlib
</pre>
<li>Run the script to train and test the regression model:</li>
<pre>
python car_purchase_prediction.py
</pre>
<p>The script will output the accuracy of the trained model and a scatter plot showing the actual prices vs. predicted prices.</p>
You can customize the model by modifying the parameters in the car_purchase_prediction.py script. The following parameters can be adjusted:
TEST_SIZE: Proportion of data used for testing (default: 0.2)RANDOM_STATE: Random seed used for train-test split (default: 42)N_JOBS: Number of CPU cores used for training (default: -1)
You can also use different regression algorithms or tune hyperparameters to improve the accuracy of the model.
This project is licensed under the MIT License - see the LICENSE file for details.