This project uses machine learning to predict car purchase prices, leveraging XGBoost, Random Forest, and DNN algorithms for accurate forecasting. By analyzing historical sales data, the model learns patterns and trends to project future demand. This code covers data preprocessing, model training, and evaluation, offering a reliable approach to sales prediction.
This project is run on Kaggle instead of Google Colab. Before running the code, ensure that the following libraries are pre-installed:
- Torch: For deep learning support and model training.
- Sklearn: For various machine learning utilities and metrics.
- Pandas: For data manipulation and analysis.
- Numpy: For numerical computations and array handling.
To install these libraries, you can use the following command:
!pip install torch scikit-learn pandas numpy
The sales data for this project was downloaded from Sales Prediction Dataset.
Model | Mean Absolute Error | R-Squared |
---|---|---|
DNN | 234 | 0.99 |
XGBoost | 410 | 0.99 |
Random Forest | 530 | 0.93 |
In addition, training shows that 'credit card debt' doesn't help to predict 'car purchase amount' and that 'age' is the most important feature.