Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,7 @@ def predict_house_price(longitude, latitude, housing_median_age, total_rooms,
|
|
| 37 |
input_data = scaler.transform([[longitude, latitude, housing_median_age, total_rooms,
|
| 38 |
total_bedrooms, population, households, median_income]])
|
| 39 |
prediction = model.predict(input_data)[0]
|
| 40 |
-
return prediction
|
| 41 |
|
| 42 |
# Create dashboard function
|
| 43 |
def create_dashboard():
|
|
@@ -57,14 +57,14 @@ def create_dashboard():
|
|
| 57 |
iface_predict = gr.Interface(
|
| 58 |
fn=predict_house_price,
|
| 59 |
inputs=[
|
| 60 |
-
gr.Number(label="Longitude"
|
| 61 |
-
gr.Number(label="Latitude"),
|
| 62 |
-
gr.Number(label="Housing Median Age"),
|
| 63 |
-
gr.Number(label="Total Rooms"),
|
| 64 |
-
gr.Number(label="Total Bedrooms"),
|
| 65 |
-
gr.Number(label="Population"),
|
| 66 |
-
gr.Number(label="Households"),
|
| 67 |
-
gr.Number(label="Median Income")
|
| 68 |
],
|
| 69 |
outputs="text",
|
| 70 |
title="House Price Prediction",
|
|
|
|
| 37 |
input_data = scaler.transform([[longitude, latitude, housing_median_age, total_rooms,
|
| 38 |
total_bedrooms, population, households, median_income]])
|
| 39 |
prediction = model.predict(input_data)[0]
|
| 40 |
+
return f"${prediction:,.2f}"
|
| 41 |
|
| 42 |
# Create dashboard function
|
| 43 |
def create_dashboard():
|
|
|
|
| 57 |
iface_predict = gr.Interface(
|
| 58 |
fn=predict_house_price,
|
| 59 |
inputs=[
|
| 60 |
+
gr.Number(label="Longitude", info="Enter the longitude of the house."),
|
| 61 |
+
gr.Number(label="Latitude", info="Enter the latitude of the house."),
|
| 62 |
+
gr.Number(label="Housing Median Age", info="Enter the median age of the house."),
|
| 63 |
+
gr.Number(label="Total Rooms", info="Enter the total number of rooms."),
|
| 64 |
+
gr.Number(label="Total Bedrooms", info="Enter the total number of bedrooms."),
|
| 65 |
+
gr.Number(label="Population", info="Enter the population in the area."),
|
| 66 |
+
gr.Number(label="Households", info="Enter the number of households in the area."),
|
| 67 |
+
gr.Number(label="Median Income", info="Enter the median income of the households.")
|
| 68 |
],
|
| 69 |
outputs="text",
|
| 70 |
title="House Price Prediction",
|