Mayank-2002 commited on
Commit
38ddb0a
1 Parent(s): 766aaba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -15,7 +15,7 @@ def predict_price(location, sqft, bath, bhk):
15
  if loc_index >= 0:
16
  x[loc_index] = 1
17
 
18
- return abs(lr_clf.predict([x])[0])
19
 
20
  with open('./model.pkl', 'rb') as f:
21
  lr_clf = pickle.load(f)
@@ -33,7 +33,7 @@ def main():
33
  if st.button("Predict"):
34
  # Perform prediction
35
  prediction = predict_price(location, sqft, bath, bhk)
36
- st.success(f"The predicted price is: {prediction:0.2f} lakhs")
37
 
38
  if __name__ == "__main__":
39
  main()
 
15
  if loc_index >= 0:
16
  x[loc_index] = 1
17
 
18
+ return round(abs(lr_clf.predict([x])[0]), 2)
19
 
20
  with open('./model.pkl', 'rb') as f:
21
  lr_clf = pickle.load(f)
 
33
  if st.button("Predict"):
34
  # Perform prediction
35
  prediction = predict_price(location, sqft, bath, bhk)
36
+ st.success(f"The predicted price is: {prediction} lakhs")
37
 
38
  if __name__ == "__main__":
39
  main()