Update prediction.py
Browse files- prediction.py +29 -29
prediction.py
CHANGED
|
@@ -48,42 +48,42 @@ price_max = meta["price_max"]
|
|
| 48 |
# dan ram_norm karena performa CPU dan RAM paling penting untuk gaming.
|
| 49 |
|
| 50 |
PRIORITY_WEIGHTS = {
|
| 51 |
-
|
| 52 |
'gaming': {
|
| 53 |
-
'cpu_tier_norm':
|
| 54 |
-
'ram_norm':
|
| 55 |
-
'battery_norm':
|
| 56 |
-
'price_to_perf':
|
| 57 |
-
'camera_norm':
|
| 58 |
-
'battery_efficiency':0.05,
|
| 59 |
},
|
| 60 |
-
|
| 61 |
'camera': {
|
| 62 |
-
'camera_norm':
|
| 63 |
-
'cpu_tier_norm':
|
| 64 |
-
'ram_norm':
|
| 65 |
-
'battery_norm':
|
| 66 |
-
'battery_efficiency':0.10,
|
| 67 |
-
'price_to_perf':
|
| 68 |
},
|
| 69 |
-
|
| 70 |
'budget': {
|
| 71 |
-
'
|
| 72 |
-
'battery_efficiency': 0.25,
|
| 73 |
-
'
|
| 74 |
-
'ram_norm': 0.10,
|
| 75 |
-
'cpu_tier_norm': 0.05,
|
| 76 |
-
'camera_norm': 0.05,
|
| 77 |
-
},
|
| 78 |
-
|
| 79 |
'balanced': {
|
| 80 |
-
'cpu_tier_norm':
|
| 81 |
-
'ram_norm':
|
| 82 |
-
'price_to_perf':
|
| 83 |
-
'battery_norm':
|
| 84 |
-
'camera_norm':
|
| 85 |
-
'battery_efficiency':0.10,
|
| 86 |
},
|
|
|
|
| 87 |
}
|
| 88 |
|
| 89 |
# Mapping priority ke nama segmen cluster tertentu
|
|
|
|
| 48 |
# dan ram_norm karena performa CPU dan RAM paling penting untuk gaming.
|
| 49 |
|
| 50 |
PRIORITY_WEIGHTS = {
|
|
|
|
| 51 |
'gaming': {
|
| 52 |
+
'cpu_tier_norm': 0.35, # raw processing power is #1 for gamers
|
| 53 |
+
'ram_norm': 0.30, # games need memory for loading assets
|
| 54 |
+
'battery_norm': 0.25, # games are battery-hungry
|
| 55 |
+
'price_to_perf': 0.25, # gaming phones can be pricey; value matters
|
| 56 |
+
'camera_norm': 0.05, # camera is secondary for gamers
|
| 57 |
+
'battery_efficiency': 0.05,
|
| 58 |
},
|
| 59 |
+
|
| 60 |
'camera': {
|
| 61 |
+
'camera_norm': 0.55, # dominant: highest MP sensor is the main ask
|
| 62 |
+
'cpu_tier_norm': 0.15, # camera processing pipeline needs a decent chip
|
| 63 |
+
'ram_norm': 0.10,
|
| 64 |
+
'battery_norm': 0.10,
|
| 65 |
+
'battery_efficiency': 0.10,
|
| 66 |
+
'price_to_perf': 0.10,
|
| 67 |
},
|
| 68 |
+
|
| 69 |
'budget': {
|
| 70 |
+
'battery_norm': 0.15,
|
| 71 |
+
'battery_efficiency': 0.25,
|
| 72 |
+
'price_to_perf': 0.40,
|
| 73 |
+
'ram_norm': 0.10,
|
| 74 |
+
'cpu_tier_norm': 0.05,
|
| 75 |
+
'camera_norm': 0.05,
|
| 76 |
+
},
|
| 77 |
+
|
| 78 |
'balanced': {
|
| 79 |
+
'cpu_tier_norm': 0.20,
|
| 80 |
+
'ram_norm': 0.20,
|
| 81 |
+
'price_to_perf': 0.20,
|
| 82 |
+
'battery_norm': 0.15,
|
| 83 |
+
'camera_norm': 0.20,
|
| 84 |
+
'battery_efficiency': 0.10,
|
| 85 |
},
|
| 86 |
+
|
| 87 |
}
|
| 88 |
|
| 89 |
# Mapping priority ke nama segmen cluster tertentu
|