Spaces:
Sleeping
Sleeping
File size: 864 Bytes
48066be 66dcd68 7942c5b 4a90c8a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import streamlit as st
import pickle
import pandas as pd
import numpy as np
# import requests
data =pd.read_csv('clean_data.csv')
pipe=pickle.load(open("LinearModle_.pkl",'rb'))
location =st.selectbox('Select the location',data['location'].unique())
bhk =st.number_input("Enter the BHK ",step=1)
bath =st.number_input("Enter the number of Bathrooms",step=1)
sqft =st.number_input("Enter the the area of flat")
def predict():
input= pd.DataFrame([[location,sqft,bath,bhk]],columns=['location','total_sqft','bath','bhk'])
prediction = pipe.predict(input)[0] * 1e5 # Its converted into lakhs
print(prediction)
# print(type(location),type(bhk),type(bath),type(sqft))
return np.abs(np.round(prediction,2))
if(st.button('Check_the_price')):
st.write("The approximate price of this property is: ")
st.write(predict()," In Indian Ruppee")
|