kingabzpro commited on
Commit
aa6b40b
1 Parent(s): 4aa2b65

scaled the features

Browse files
Files changed (2) hide show
  1. app.py +5 -1
  2. std_scaler.bin +3 -0
app.py CHANGED
@@ -4,6 +4,9 @@ import joblib
4
  # Load the trained model
5
  model = joblib.load("loan_classifier.joblib")
6
 
 
 
 
7
 
8
  def predict_loan_status(
9
  int_rate,
@@ -35,7 +38,8 @@ def predict_loan_status(
35
  }
36
  # Convert the dictionary to a 2D array
37
  input_array = [list(input_dict.values())]
38
- prediction = model.predict(input_array)[0]
 
39
 
40
  if prediction == 0:
41
  return "Loan fully paid"
 
4
  # Load the trained model
5
  model = joblib.load("loan_classifier.joblib")
6
 
7
+ # Load Standared Scaler
8
+ scalar = joblib.load("std_scaler.bin")
9
+
10
 
11
  def predict_loan_status(
12
  int_rate,
 
38
  }
39
  # Convert the dictionary to a 2D array
40
  input_array = [list(input_dict.values())]
41
+ scaled_array = scalar.transform(input_array)
42
+ prediction = model.predict(scaled_array)[0]
43
 
44
  if prediction == 0:
45
  return "Loan fully paid"
std_scaler.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e946c7c12fd6413a01cfd3cf6f3a1b69a5c88f042872bf8beba7ca3c928427c4
3
+ size 1330