HyraXuna commited on
Commit
121bf01
·
verified ·
1 Parent(s): d87a0ac

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -613,20 +613,20 @@ elif page == "💸 Price Prediction":
613
 
614
  # Prepare input data as JSON
615
  input_data = pd.DataFrame({
616
- "model_key": car_model,
617
- "mileage": mileage,
618
- "engine_power": engine_power,
619
- "fuel": fuel,
620
- "paint_color": paint_color,
621
- "car_type": car_type,
622
- "private_parking_available": private_parking_available,
623
- "has_gps": has_gps,
624
- "has_air_conditioning": has_air_conditioning,
625
- "automatic_car": automatic_car,
626
- "has_getaround_connect": has_getaround_connect,
627
- "has_speed_regulator": has_speed_regulator,
628
- "winter_tires": winter_tires
629
- })
630
 
631
  # Load the preprocessor
632
  with open('preprocessor.pkl', 'rb') as file:
 
613
 
614
  # Prepare input data as JSON
615
  input_data = pd.DataFrame({
616
+ "model_key": [car_model], # Wrap scalars in lists
617
+ "mileage": [mileage],
618
+ "engine_power": [engine_power],
619
+ "fuel": [fuel],
620
+ "paint_color": [paint_color],
621
+ "car_type": [car_type],
622
+ "private_parking_available": [private_parking_available],
623
+ "has_gps": [has_gps],
624
+ "has_air_conditioning": [has_air_conditioning],
625
+ "automatic_car": [automatic_car],
626
+ "has_getaround_connect": [has_getaround_connect],
627
+ "has_speed_regulator": [has_speed_regulator],
628
+ "winter_tires": [winter_tires]
629
+ })
630
 
631
  # Load the preprocessor
632
  with open('preprocessor.pkl', 'rb') as file: