House_Price_Prediction / src /streamlit_app.py
Jacklin08's picture
Update src/streamlit_app.py
122bd9c verified
raw
history blame contribute delete
712 Bytes
import streamlit as st
import joblib
import numpy as np
with open("src/House_linear","rb") as f:
model = joblib.load(f)
st.title(":red[House] Price Analysis :house:")
Bedrooms=st.number_input("bedooms:",min_value=1,max_value=8,step=1)
Bathrooms=st.number_input("Bathooms:",min_value=1,max_value=9,step=1)
Sqft_living=st.number_input("Sqft_living:",min_value=100,max_value=8000,step=1)
Floors=st.number_input("Floors:",min_value=1,max_value=10,step=1)
if st.button("Estimate"):
st.balloons()
model_input=np.array([[Bedrooms,Bathrooms,Sqft_living,Floors]])
prediction=model.predict(model_input)
formatted_pred=round(prediction[0],2)
st.write(f"House price is :${formatted_pred}")