Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -71,21 +71,21 @@ def load_model_and_encodings():
|
|
71 |
def predict_price(model, brand, model_name, year):
|
72 |
# Create a dictionary with default values for the specified categories
|
73 |
input_data = {
|
74 |
-
'
|
75 |
-
'
|
76 |
-
'
|
77 |
-
'
|
78 |
-
'
|
79 |
-
'
|
80 |
-
'
|
81 |
-
'
|
82 |
-
'
|
83 |
-
'
|
84 |
-
'
|
85 |
-
'
|
86 |
-
'
|
87 |
-
'
|
88 |
-
'
|
89 |
}
|
90 |
|
91 |
# Prepare the input for the model
|
|
|
71 |
def predict_price(model, brand, model_name, year):
|
72 |
# Create a dictionary with default values for the specified categories
|
73 |
input_data = {
|
74 |
+
'Year': year,
|
75 |
+
'Odometer': year * 12000, # Estimate based on year and average annual mileage
|
76 |
+
'Age': datetime.now().year - year,
|
77 |
+
'Age_squared': (datetime.now().year - year) ** 2,
|
78 |
+
'Mileage_per_year': 12000,
|
79 |
+
'Make': brand, # Use the separated make
|
80 |
+
'Model': model_name, # Use the separated model
|
81 |
+
'Condition': 'Used',
|
82 |
+
'Fuel': 'Gasoline',
|
83 |
+
'Title_status': 'Clean',
|
84 |
+
'Transmission': 'Automatic',
|
85 |
+
'Drive': 'Fwd',
|
86 |
+
'Size': 'Mid-Size',
|
87 |
+
'Type': 'Sedan',
|
88 |
+
'Paint_color': 'White'
|
89 |
}
|
90 |
|
91 |
# Prepare the input for the model
|