Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -36,8 +36,8 @@ def scaler(data, runtime = False):
|
|
36 |
X_train = scaler(X_train)
|
37 |
X_test = scaler(X_test, True)
|
38 |
|
39 |
-
|
40 |
-
|
41 |
|
42 |
features = {
|
43 |
"person_home_ownership": ['MORTGAGE', 'OTHER','OWN', 'RENT',],
|
@@ -76,7 +76,7 @@ def credit_run(person_age, person_income, person_home_ownership,
|
|
76 |
'cb_person_cred_hist_length': cb_person_cred_hist_length
|
77 |
}, index = [0]
|
78 |
))
|
79 |
-
out =
|
80 |
return "High risk of defaulting" if out[0] == 1 else "Low risk of defaulting"
|
81 |
|
82 |
demo = gr.Interface(
|
|
|
36 |
X_train = scaler(X_train)
|
37 |
X_test = scaler(X_test, True)
|
38 |
|
39 |
+
rf_model = RandomForestClassifier(max_depth = 5)
|
40 |
+
rf_model.fit(X_train, y_train)
|
41 |
|
42 |
features = {
|
43 |
"person_home_ownership": ['MORTGAGE', 'OTHER','OWN', 'RENT',],
|
|
|
76 |
'cb_person_cred_hist_length': cb_person_cred_hist_length
|
77 |
}, index = [0]
|
78 |
))
|
79 |
+
out = rf_model.predict(model_input)
|
80 |
return "High risk of defaulting" if out[0] == 1 else "Low risk of defaulting"
|
81 |
|
82 |
demo = gr.Interface(
|