Downloads · 30 days
0
Yoav-omer/yoav-omer-used-cars-price-random-forest
yoav-omer-used-cars-price-random-forest is a machine learning model from Yoav-omer. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This project builds a complete Machine Learning workflow for predicting and classifying used car prices using a large real-world dataset from Craigslist. Both the regression and classification winning models are avail…
Downloads · 30 days
0
Access
Public
Updated Dec 9, 2025
Repo size
1.6 GB
Likes
0
Public
Click a slice to open those files.
.csv1.4 GB · 90%
From the Hugging Face model README
This project builds a complete Machine Learning workflow for predicting and classifying used car prices using a large real-world dataset from Craigslist.
Both the regression and classification winning models are available in this repository.
https://drive.google.com/file/d/1sYohB3E4Sdb8ewkVP3S7uZXy2G06tS3l/view?usp=sharing
Source: Kaggle — Craigslist Cars & Trucks Data
Rows: 426,880 → 339,346 after cleaning
Features: numeric, categorical, geolocation
Targets:
price
Prices are heavily right-skewed, with most cars priced under $20,000.

Clear positive trend: newer cars command higher prices.

Strong negative correlation: more mileage → lower value.

Significant variation across manufacturers (e.g., BMW > Toyota > Chevrolet).
To improve model performance, multiple new features were created:
car_age = 2023 - yearmileage_per_yearmanufacturer_popularity (frequency-based)is_electric, is_hybridcluster_kmeans to capture structural patternsThis contributed strongly to non-linear model performance.
Performance (no feature engineering):
| Model | R² | RMSE | Winner |
|---|---|---|---|
| Linear Regression + FE | ~0.70 | ↓ | |
| Gradient Boosting | ~0.78 | ↓ | |
| Random Forest Regressor | 0.783 | 6818 | 🏆 Yes |
Winner: Random Forest Regressor
It captured non-linear relationships and benefited the most from engineered features.
📥 Model file: random_forest_used_cars_model.pkl
Price converted into three balanced classes using quantile binning:
Missing high-value cars (false negatives) is more harmful than mistakenly predicting a car as high-value.
| Model | Macro F1 | Accuracy |
|---|---|---|
| Logistic Regression | 0.62 | 0.63 |
| Gradient Boosting | 0.78 | 0.79 |
| Random Forest Classifier | 0.82 | 0.82 |
Winner: Random Forest Classifier
Best F1 across all classes and fewest severe misclassifications (especially between Low ↔ High).
📥 Model file: used_cars_price_classifier_rf.pkl
yoav-omer-used-cars-price-random-forest
│
├── random_forest_used_cars_model.pkl # Regression model
├── used_cars_price_classifier_rf.pkl # Classification model
│
├── price_hist.png
├── year_price.png
├── odometer_price.png
├── manufacturer_price.png
│
└── README.md
This project demonstrates a full machine learning pipeline on a complex real-world dataset, including:
Random Forest delivered the best results in both regression and classification tasks.