Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -34,23 +34,23 @@ def main():
|
|
34 |
not_fully_paid = st.slider("not fully paid.", 0,100)
|
35 |
|
36 |
# clicked==True only when the button is clicked
|
37 |
-
clicked = st.form_submit_button("Predict
|
38 |
if clicked:
|
39 |
-
result=model.predict(pd.DataFrame({"purpose":
|
40 |
-
"int.rate":
|
41 |
-
"installment":
|
42 |
-
"log.annual.inc":
|
43 |
-
"dti":
|
44 |
-
"fico":
|
45 |
-
"days.with.cr.line":
|
46 |
-
"revol.bal":
|
47 |
-
"revol.util":
|
48 |
-
"inq.last.6mths":
|
49 |
"delinq.2yrs":[delinq_2yrs],
|
50 |
-
"pub.rec":
|
51 |
-
"not.fully.paid":
|
52 |
# Show prediction
|
53 |
-
result = 'Pass' if result[
|
54 |
st.success("Your predicted loan is "+result) #แสดงผล
|
55 |
|
56 |
# Run main()
|
|
|
34 |
not_fully_paid = st.slider("not fully paid.", 0,100)
|
35 |
|
36 |
# clicked==True only when the button is clicked
|
37 |
+
clicked = st.form_submit_button("Predict loan")
|
38 |
if clicked:
|
39 |
+
result=model.predict(pd.DataFrame({"purpose":[purpose_1],
|
40 |
+
"int.rate":[int_rate],
|
41 |
+
"installment":[installments],
|
42 |
+
"log.annual.inc":[log_annual_inc],
|
43 |
+
"dti":[dti],
|
44 |
+
"fico":[fico],
|
45 |
+
"days.with.cr.line":[days_with_cr_line],
|
46 |
+
"revol.bal":[revol_bal],
|
47 |
+
"revol.util":[revol_util],
|
48 |
+
"inq.last.6mths":[inq_last_6mths],
|
49 |
"delinq.2yrs":[delinq_2yrs],
|
50 |
+
"pub.rec":[pub_rec],
|
51 |
+
"not.fully.paid":[not_fully_paid]}))
|
52 |
# Show prediction
|
53 |
+
result = 'Pass' if result[0] == 0 else 'Not Pass'
|
54 |
st.success("Your predicted loan is "+result) #แสดงผล
|
55 |
|
56 |
# Run main()
|