weewoo2636 commited on
Commit
5d59558
1 Parent(s): 45c8de4

add scaler before prediction

Browse files
Files changed (2) hide show
  1. prediction.py +7 -2
  2. scaler.pkl +3 -0
prediction.py CHANGED
@@ -17,9 +17,14 @@ def app():
17
  st.subheader('User Input')
18
  st.write(input)
19
 
20
- load_model = joblib.load("model.pkl")
 
 
 
 
21
 
22
- prediction = load_model.predict(input)
 
23
 
24
  if prediction == 1:
25
  prediction = 'Payment Defaulted (1)'
 
17
  st.subheader('User Input')
18
  st.write(input)
19
 
20
+ load_scaler = joblib.load('scaler.pkl')
21
+ input_scaled = load_scaler.transform(input)
22
+
23
+ st.subheader('Scaled User Input')
24
+ st.write(input_scaled)
25
 
26
+ load_model = joblib.load("model.pkl")
27
+ prediction = load_model.predict(input_scaled)
28
 
29
  if prediction == 1:
30
  prediction = 'Payment Defaulted (1)'
scaler.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f10c8066797afdcce8c90c6399b2795eb02046184a9f969ac9b0dca4a338e574
3
+ size 858