Housing_Price_Quotation / src /streamlit_app.py
kishorevasudevanit's picture
Update src/streamlit_app.py
1efc814 verified
raw
history blame contribute delete
900 Bytes
import streamlit as st
import joblib
import numpy as np
from sklearn.preprocessing import StandardScaler
with open("src/housing_linear","rb") as f:
model = joblib.load(f)
with open("src/X_model","rb") as f:
X_model = joblib.load(f)
st.title(":green[HOUSE] PRICE QUOTATION(USA) :house:")
bedrooms = st.number_input("Bedroom : ",min_value=1,max_value=10,step=1)
bathrooms = st.number_input("Bathroom : ",min_value=1.0,max_value=10.0,step=0.5)
floors = st.number_input("Floor :",min_value=1,max_value=10,step=1)
sqft_living = st.number_input("Sqft_Living :",min_value=370.0,max_value=4310.0,step=100.0)
if st.button("Estimate"):
model_inputs = np.array([[bedrooms,bathrooms,floors,sqft_living]])
model_input=X_model.transform(model_inputs)
prediction = model.predict(model_input)
formatted_price = round(prediction[0],2)
st.success(f"Quoted_Price : ${formatted_price}")