Spaces:
Sleeping
Sleeping
File size: 542 Bytes
a18ee5a bf45108 |
1 2 3 4 5 6 7 8 9 10 11 12 |
def predict_default(income, loan_amount, credit_score, employment):
# Simplified risk calculation
risk_score = (loan_amount / (income * 0.3)) * (1 - (credit_score/850))
if employment == "Unemployed":
risk_score *= 1.5
if risk_score > 0.7:
return {"High Risk": risk_score, "Medium Risk": 0.2, "Low Risk": 0.1}
elif risk_score > 0.4:
return {"High Risk": 0.3, "Medium Risk": risk_score, "Low Risk": 0.2}
else:
return {"High Risk": 0.1, "Medium Risk": 0.3, "Low Risk": risk_score} |