Spaces:
No application file
No application file
Update app.py
Browse files
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 |
-
|
|
|
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"
|