๐ AI Car Price Prediction Model (Gradient Boosting)
This is a trained Gradient Boosting Regressor model designed for estimating used car market values based on key vehicle attributes.
๐ Model Performance
- Rยฒ Score:
0.9787(97.87% variance explained) - Mean Absolute Error (MAE):
$2,390.93
๐งฎ Model Inputs
brand: Vehicle make (Toyota, Honda, Ford, BMW, Mercedes-Benz, Audi, Hyundai, Tesla, Chevrolet, Volkswagen)year: Model year (2010 - 2025)mileage: Total mileage drivenbody_type: Sedan, SUV, Hatchback, Coupe, Truck, Convertiblefuel_type: Petrol, Diesel, Hybrid, Electrictransmission: Automatic, Manualcondition: Excellent, Good, Fair, Poorengine_size: Engine displacement in Liters (1.0 - 5.0L)horsepower: Engine power output in HPowners: Number of previous owners (1 - 4)
๐ป Python Usage Example
import pickle
import pandas as pd
from huggingface_hub import hf_hub_download
# Download model from Hugging Face Hub
model_path = hf_hub_download(repo_id="abersbail/car-price-model", filename="car_price_model.pkl")
with open(model_path, "rb") as f:
model = pickle.load(f)
# Sample prediction
sample_car = pd.DataFrame([{
'brand': 'Toyota',
'year': 2022,
'mileage': 25000,
'body_type': 'SUV',
'fuel_type': 'Hybrid',
'transmission': 'Automatic',
'condition': 'Excellent',
'engine_size': 2.5,
'horsepower': 219,
'owners': 1
}])
estimated_price = model.predict(sample_car)[0]
print(f"Estimated Market Value: ${estimated_price:,.2f}")
๐ License
MIT License