File size: 806 Bytes
db90c9f
eec5303
 
db90c9f
7aaadb0
eec5303
 
7aaadb0
e436bd4
 
 
 
eec5303
 
 
7493637
eec5303
 
e436bd4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import streamlit as st
import joblib
import numpy as np

with open("src/house_model", "rb") as f:
    model = joblib.load(f)

st.title(":blue[Smart] Property Price Estimator :house:")
bedrooms = st.number_input("Bedrooms:", min_value=1, max_value=10, step=1)
bathrooms = st.number_input("Bathrooms:", min_value=1, max_value=10, step=1)
sqft_living = st.number_input("Living Area (sqft):", min_value=100, max_value=10000, step=1)
floors = st.number_input("Number of Floors:", min_value=1, max_value=10, step=1)

if st.button("Analysis"):
    st.snow()
    model_input = np.array([[bedrooms, bathrooms, sqft_living, floors]])
    prediction = model.predict(model_input)
    formatted_pred = round(prediction[0],2)
    st.success(f"The estimated price for your selected 🏡 property is: ${formatted_pred:,}")