Views
No views yet
0.9787 (97.87% variance explained)$2,390.93brand: 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)1import pickle
2import pandas as pd
3from huggingface_hub import hf_hub_download
4
5# Download model from Hugging Face Hub
6model_path = hf_hub_download(repo_id="abersbail/car-price-model", filename="car_price_model.pkl")
7
8with open(model_path, "rb") as f:
9 model = pickle.load(f)
10
11# Sample prediction
12sample_car = pd.DataFrame([{
13 'brand': 'Toyota',
14 'year': 2022,
15 'mileage': 25000,
16 'body_type': 'SUV',
17 'fuel_type': 'Hybrid',
18 'transmission': 'Automatic',
19 'condition': 'Excellent',
20 'engine_size': 2.5,
21 'horsepower': 219,
22 'owners': 1
23}])
24
25estimated_price = model.predict(sample_car)[0]
26print(f"Estimated Market Value: ${estimated_price:,.2f}")