Spaces:
Runtime error
Runtime error
update app.py
Browse files
app.py
CHANGED
|
@@ -13,6 +13,7 @@ from utils import *
|
|
| 13 |
|
| 14 |
########## Title for the Web App ##########
|
| 15 |
st.title("Property Price Predictor")
|
|
|
|
| 16 |
st.markdown("""This app predicts your house price based on a few indicators, and displays amenities within 2 km. Please note the following:
|
| 17 |
- Only property types allowed are HDB, Condominium, Executive Condominium and Apartment.
|
| 18 |
- Model was trained on **resale, leasehold** properties from 2021 onwards to account for COVID-19 effects; predictions for new and/or freehold properties will not be accurate.
|
|
@@ -130,16 +131,16 @@ with st.form("inputs"):
|
|
| 130 |
prediction_price = round(prediction_psf * input_floor_area_sqft)
|
| 131 |
|
| 132 |
if latlong_geo_nolatlong_encoded['propertyType_Apartment'].item() == 1:
|
| 133 |
-
st.success("The predicted price of your property is ${:,}, with 95% confidence interval
|
| 134 |
prediction_price, int(prediction_price - 2*sd_hdb*input_floor_area_sqft), int(prediction_price + 2*sd_hdb*input_floor_area_sqft)))
|
| 135 |
elif latlong_geo_nolatlong_encoded['propertyType_Condominium'].item() == 1:
|
| 136 |
-
st.success("The predicted price of your property is ${:,}, with 95% confidence interval
|
| 137 |
prediction_price, int(prediction_price - 2*sd_condo*input_floor_area_sqft), int(prediction_price + 2*sd_condo*input_floor_area_sqft)))
|
| 138 |
elif latlong_geo_nolatlong_encoded['propertyType_Executive_Condominium'].item() == 1:
|
| 139 |
-
st.success("The predicted price of your property is ${:,}, with 95% confidence interval
|
| 140 |
prediction_price, int(prediction_price - 2*sd_ec*input_floor_area_sqft), int(prediction_price + 2*sd_ec*input_floor_area_sqft)))
|
| 141 |
elif latlong_geo_nolatlong_encoded['propertyType_HDB'].item() == 1:
|
| 142 |
-
st.success("The predicted price of your property is ${:,}, with 95% confidence interval
|
| 143 |
prediction_price, int(prediction_price - 2*sd_hdb*input_floor_area_sqft), int(prediction_price + 2*sd_hdb*input_floor_area_sqft)))
|
| 144 |
|
| 145 |
# between Jan 2017 and Oct 2022, propertyType, age, floor area range, storey
|
|
|
|
| 13 |
|
| 14 |
########## Title for the Web App ##########
|
| 15 |
st.title("Property Price Predictor")
|
| 16 |
+
st.markdown('_Creator: GOH Hong Aik [[LinkedIn]](https://www.linkedin.com/in/hongaikgoh/)_')
|
| 17 |
st.markdown("""This app predicts your house price based on a few indicators, and displays amenities within 2 km. Please note the following:
|
| 18 |
- Only property types allowed are HDB, Condominium, Executive Condominium and Apartment.
|
| 19 |
- Model was trained on **resale, leasehold** properties from 2021 onwards to account for COVID-19 effects; predictions for new and/or freehold properties will not be accurate.
|
|
|
|
| 131 |
prediction_price = round(prediction_psf * input_floor_area_sqft)
|
| 132 |
|
| 133 |
if latlong_geo_nolatlong_encoded['propertyType_Apartment'].item() == 1:
|
| 134 |
+
st.success("The predicted price of your property is ${:,}, with 95% confidence interval at ${:,} - ${:,}.".format(
|
| 135 |
prediction_price, int(prediction_price - 2*sd_hdb*input_floor_area_sqft), int(prediction_price + 2*sd_hdb*input_floor_area_sqft)))
|
| 136 |
elif latlong_geo_nolatlong_encoded['propertyType_Condominium'].item() == 1:
|
| 137 |
+
st.success("The predicted price of your property is ${:,}, with 95% confidence interval at ${:,} - ${:,}.".format(
|
| 138 |
prediction_price, int(prediction_price - 2*sd_condo*input_floor_area_sqft), int(prediction_price + 2*sd_condo*input_floor_area_sqft)))
|
| 139 |
elif latlong_geo_nolatlong_encoded['propertyType_Executive_Condominium'].item() == 1:
|
| 140 |
+
st.success("The predicted price of your property is ${:,}, with 95% confidence interval at ${:,} - ${:,}.".format(
|
| 141 |
prediction_price, int(prediction_price - 2*sd_ec*input_floor_area_sqft), int(prediction_price + 2*sd_ec*input_floor_area_sqft)))
|
| 142 |
elif latlong_geo_nolatlong_encoded['propertyType_HDB'].item() == 1:
|
| 143 |
+
st.success("The predicted price of your property is ${:,}, with 95% confidence interval at ${:,} - ${:,}.".format(
|
| 144 |
prediction_price, int(prediction_price - 2*sd_hdb*input_floor_area_sqft), int(prediction_price + 2*sd_hdb*input_floor_area_sqft)))
|
| 145 |
|
| 146 |
# between Jan 2017 and Oct 2022, propertyType, age, floor area range, storey
|