danieleduardus commited on
Commit
80df98a
·
verified ·
1 Parent(s): 6a58fec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -8
app.py CHANGED
@@ -2,14 +2,28 @@ import streamlit as st
2
  import pickle
3
 
4
  # Load the model
5
- with open('house_price_model.pkl', 'rb') as f:
6
- model = pickle.load(f)
7
 
8
- st.title('House Price Prediction 🏡')
9
  # User inputs
10
- living_area = st.number_input('Living Area (sqft)')
11
- bedrooms = st.number_input('Number of Bedrooms')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  # Predict house price
13
- if st.button('Predict Price'):
14
- prediction = model.predict([[living_area, bedrooms]])
15
- st.write(f'Predicted House Price: ${prediction[0]:.2f}')
 
2
  import pickle
3
 
4
  # Load the model
5
+ #with open('house_price_model.pkl', 'rb') as f:
6
+ # model = pickle.load(f)
7
 
8
+ #st.title('House Price Prediction 🏡')
9
  # User inputs
10
+ #living_area = st.number_input('Living Area (sqft)')
11
+ #bedrooms = st.number_input('Number of Bedrooms')
12
+
13
+ # Predict house price
14
+ #if st.button('Predict Price'):
15
+ # prediction = model.predict([[living_area, bedrooms]])
16
+ # st.write(f'Predicted House Price: ${prediction[0]:.2f}')
17
+
18
+ Load the model
19
+ with open('best_model_chi2.pkl', 'rb') as f:
20
+ model = pickle.load(f)
21
+
22
+ avg_train_score = st.text_input("AVG Train Score", "")
23
+ awards_won = st.text_input("Awards Won", "")
24
+ kpi_met = st.text_input("KPI Met 80", "")
25
+ previous_rating = st.text_input("Previous Rating", "")
26
  # Predict house price
27
+ if st.button('Predict Promosi'):
28
+ prediction = model.predict([[avg_train_score, awards_won, kpi_met, previous_rating]])
29
+ st.write(f'Predicted Result: ${prediction[0]:.2f}')