Spaces:
Sleeping
Sleeping
finishing aap correction
Browse files
app.py
CHANGED
|
@@ -592,8 +592,8 @@ elif page == "💸 Price Prediction":
|
|
| 592 |
|
| 593 |
# Define input fields for car parameters
|
| 594 |
car_model = st.selectbox("Car Brand:", ['Citroën','Peugeot','PGO','Renault','Audi','BMW','Mercedes','Opel','Volkswagen','Ferrari','Mitsubishi','Nissan','SEAT','Subaru','Toyota','other'])
|
| 595 |
-
mileage = st.slider("Mileage (km):", 0,
|
| 596 |
-
engine_power = st.slider("Engine Power (HP):", 0, 1000, 100, step=
|
| 597 |
fuel = st.selectbox("Fuel Type:", ['diesel','petrol','other'])
|
| 598 |
paint_color = st.selectbox("Paint Color:", ['black','grey','white','red','silver','blue','beige','brown','other'])
|
| 599 |
car_type = st.selectbox("Car Type:", ['convertible','coupe','estate','hatchback','sedan','subcompact','suv','van'])
|
|
@@ -612,7 +612,7 @@ elif page == "💸 Price Prediction":
|
|
| 612 |
st.subheader("💶 Prediction Results")
|
| 613 |
|
| 614 |
# Prepare input data as JSON
|
| 615 |
-
input_data = {
|
| 616 |
"model_key": car_model,
|
| 617 |
"mileage": mileage,
|
| 618 |
"engine_power": engine_power,
|
|
@@ -626,7 +626,7 @@ elif page == "💸 Price Prediction":
|
|
| 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:
|
|
|
|
| 592 |
|
| 593 |
# Define input fields for car parameters
|
| 594 |
car_model = st.selectbox("Car Brand:", ['Citroën','Peugeot','PGO','Renault','Audi','BMW','Mercedes','Opel','Volkswagen','Ferrari','Mitsubishi','Nissan','SEAT','Subaru','Toyota','other'])
|
| 595 |
+
mileage = st.slider("Mileage (km):", 0, 600000, 50000, step=1000)
|
| 596 |
+
engine_power = st.slider("Engine Power (HP):", 0, 1000, 100, step=5)
|
| 597 |
fuel = st.selectbox("Fuel Type:", ['diesel','petrol','other'])
|
| 598 |
paint_color = st.selectbox("Paint Color:", ['black','grey','white','red','silver','blue','beige','brown','other'])
|
| 599 |
car_type = st.selectbox("Car Type:", ['convertible','coupe','estate','hatchback','sedan','subcompact','suv','van'])
|
|
|
|
| 612 |
st.subheader("💶 Prediction Results")
|
| 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,
|
|
|
|
| 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:
|