NatalieCheong commited on
Commit
3e2c3fd
·
verified ·
1 Parent(s): fca5bf0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -11,6 +11,7 @@ import gradio as gr
11
  import joblib
12
  # Load the trained model
13
  model = joblib.load("loan_classifier.joblib")
 
14
 
15
 
16
  def predict_loan_status(
@@ -43,7 +44,8 @@ def predict_loan_status(
43
  }
44
  # Convert the dictionary to a 2D array
45
  input_array = [list(input_dict.values())]
46
- prediction = model.predict(input_array)[0]
 
47
 
48
  if prediction == 0:
49
  return "Loan fully paid"
 
11
  import joblib
12
  # Load the trained model
13
  model = joblib.load("loan_classifier.joblib")
14
+ scaler = joblib.load("std_scaler.bin")
15
 
16
 
17
  def predict_loan_status(
 
44
  }
45
  # Convert the dictionary to a 2D array
46
  input_array = [list(input_dict.values())]
47
+ scaled_array = scalar.transform(input_array)
48
+ prediction = model.predict(scaled_array)[0]
49
 
50
  if prediction == 0:
51
  return "Loan fully paid"