Mehriddin1997 commited on
Commit
6bcde3d
·
verified ·
1 Parent(s): 5ce95e1

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +56 -0
README.md ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: uz
3
+ license: mit
4
+ tags:
5
+ - xgboost
6
+ - regression
7
+ - car-price-prediction
8
+ - automotive
9
+ - uzbekistan
10
+ metrics:
11
+ - r2: 0.9007
12
+ - mae: 682.02
13
+ ---
14
+
15
+ # 🚗 XGBoost Avtomobil Narxini Bashorat Qilish (Uzbekistan Market)
16
+
17
+ Ushbu model O'zbekistondagi mashhur avtomobil modellari va ularning bozor narxlari asosida o'qitilgan. Model yili, masofasi va transmissiyasiga qarab avtomobil narxini ($) bashorat qiladi.
18
+
19
+ ## 📊 Model Natijalari
20
+ * **Aniqlik (R2 Score):** 0.9007
21
+ * **O'rtacha xatolik (MAE):** $682.02
22
+
23
+ ## 🛠 Modelni Ishlatish (Usage Guide)
24
+
25
+ Modelni yuklash va bashorat qilish uchun quyidagi Python kodidan foydalaning:
26
+
27
+ ```python
28
+ import xgboost as xgb
29
+ import pandas as pd
30
+ from huggingface_hub import hf_hub_download
31
+
32
+ # 1. Modelni yuklab olish
33
+ model_path = hf_hub_download(repo_id="Mehriddin1997/xgboost_car_model", filename="xgboost_car_model.json")
34
+
35
+ # 2. Modelni yuklash
36
+ model = xgb.XGBRegressor()
37
+ model.load_model(model_path)
38
+
39
+ # 3. Mashina modelini aniqlash (Dictionary)
40
+ car_models = {
41
+ 1: "Captiva", 2: "Cobalt", 3: "Damas", 4: "Epica", 5: "Equinox",
42
+ 6: "Gentra", 7: "Labo", 8: "Lacetti", 9: "Malibu", 10: "Matiz",
43
+ 11: "Nexia", 12: "Onix", 13: "Orlando", 14: "Spark", 15: "Tracker"
44
+ }
45
+
46
+ def predict_car(year, mileage, transmission, model_id):
47
+ # Model o'qitilgan ustun nomlari bilan bir xil dataframe yaratamiz
48
+ data = pd.DataFrame([[year, mileage, transmission, model_id]],
49
+ columns=['year', 'yurgan_masofasi', 'transmission', 'model'])
50
+
51
+ price = model.predict(data)[0]
52
+ return price
53
+
54
+ # Test: 2022-yil, 35,000 km, Avtomat (1), Cobalt (2)
55
+ res = predict_car(2022, 35000, 1, 2)
56
+ print(f"Bashorat qilingan narx: ${res:,.2f}")