DOMMETI commited on
Commit
8bbc201
ยท
verified ยท
1 Parent(s): 7468c2f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
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
- # Title of the application
15
  st.markdown("<h1 class='title'>๐Ÿก House Price Predictor</h1>", unsafe_allow_html=True)
16
 
17
- # Input Section for Property Details
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
- # Make prediction using the model
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)