Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,10 +11,10 @@ except FileNotFoundError:
|
|
| 11 |
st.error("โ Model file not found! Please upload `final_model.pkl`.")
|
| 12 |
model = None
|
| 13 |
|
| 14 |
-
|
| 15 |
st.markdown("<h1 class='title'>๐ก House Price Predictor</h1>", unsafe_allow_html=True)
|
| 16 |
|
| 17 |
-
|
| 18 |
with st.expander("๐น **Property Details**", expanded=True):
|
| 19 |
POSTED_BY = st.selectbox("POSTED_BY", ["Owner", "Dealer", "Builder"])
|
| 20 |
UNDER_CONSTRUCTION = st.selectbox("UNDER_CONSTRUCTION", [1, 0])
|
|
@@ -28,16 +28,13 @@ with st.expander("๐น **Property Details**", expanded=True):
|
|
| 28 |
LATITUDE = st.number_input("LATITUDE", min_value=-121.761248, max_value=152.962676, value=77.324137)
|
| 29 |
|
| 30 |
if st.button("๐ Predict Price"):
|
| 31 |
-
# Create input data for prediction, using pandas DataFrame with proper column names
|
| 32 |
input_data = pd.DataFrame([[POSTED_BY, UNDER_CONSTRUCTION, RERA, BHK_NO_, BHK_OR_RK, SQUARE_FT,
|
| 33 |
READY_TO_MOVE, RESALE, LONGITUDE, LATITUDE]],
|
| 34 |
columns=["POSTED_BY", "UNDER_CONSTRUCTION", "RERA", "BHK_NO.", "BHK_OR_RK", "SQUARE_FT",
|
| 35 |
"READY_TO_MOVE", "RESALE", "LONGITUDE", "LATITUDE"])
|
| 36 |
|
| 37 |
-
# Print column names to check for issues
|
| 38 |
-
st.write(input_data.columns)
|
| 39 |
|
| 40 |
-
|
| 41 |
try:
|
| 42 |
predicted_price = model.predict(input_data)[0]
|
| 43 |
st.markdown(f"<div class='result-box'>๐ Predicted Price: โน {predicted_price:.2f} Lakhs</div>", unsafe_allow_html=True)
|
|
|
|
| 11 |
st.error("โ Model file not found! Please upload `final_model.pkl`.")
|
| 12 |
model = None
|
| 13 |
|
| 14 |
+
|
| 15 |
st.markdown("<h1 class='title'>๐ก House Price Predictor</h1>", unsafe_allow_html=True)
|
| 16 |
|
| 17 |
+
|
| 18 |
with st.expander("๐น **Property Details**", expanded=True):
|
| 19 |
POSTED_BY = st.selectbox("POSTED_BY", ["Owner", "Dealer", "Builder"])
|
| 20 |
UNDER_CONSTRUCTION = st.selectbox("UNDER_CONSTRUCTION", [1, 0])
|
|
|
|
| 28 |
LATITUDE = st.number_input("LATITUDE", min_value=-121.761248, max_value=152.962676, value=77.324137)
|
| 29 |
|
| 30 |
if st.button("๐ Predict Price"):
|
|
|
|
| 31 |
input_data = pd.DataFrame([[POSTED_BY, UNDER_CONSTRUCTION, RERA, BHK_NO_, BHK_OR_RK, SQUARE_FT,
|
| 32 |
READY_TO_MOVE, RESALE, LONGITUDE, LATITUDE]],
|
| 33 |
columns=["POSTED_BY", "UNDER_CONSTRUCTION", "RERA", "BHK_NO.", "BHK_OR_RK", "SQUARE_FT",
|
| 34 |
"READY_TO_MOVE", "RESALE", "LONGITUDE", "LATITUDE"])
|
| 35 |
|
|
|
|
|
|
|
| 36 |
|
| 37 |
+
|
| 38 |
try:
|
| 39 |
predicted_price = model.predict(input_data)[0]
|
| 40 |
st.markdown(f"<div class='result-box'>๐ Predicted Price: โน {predicted_price:.2f} Lakhs</div>", unsafe_allow_html=True)
|