Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -342,16 +342,16 @@ with tab1:
|
|
342 |
manual_rejection = False
|
343 |
rejection_reason = ""
|
344 |
|
345 |
-
# Rule-based rejections that override the model
|
346 |
if total_income < 1500:
|
347 |
manual_rejection = True
|
348 |
-
rejection_reason = "Insufficient income
|
349 |
-
elif dti_percent > 50:
|
350 |
manual_rejection = True
|
351 |
-
rejection_reason = "
|
352 |
elif credit_history == 0 and dti_percent > 35:
|
353 |
manual_rejection = True
|
354 |
-
rejection_reason = "
|
355 |
|
356 |
# Final decision combines model prediction and manual eligibility checks
|
357 |
final_approval = (prediction[0] == 1) and not manual_rejection
|
@@ -369,7 +369,6 @@ with tab1:
|
|
369 |
<div class="result-rejected">
|
370 |
<h3 style="color: #C62828;">❌ Loan Not Approved</h3>
|
371 |
<p>Unfortunately, based on your current information, we cannot approve your loan application.</p>
|
372 |
-
<p><strong>Primary reason:</strong> {rejection_reason if manual_rejection else "Multiple factors considered by our approval algorithm"}</p>
|
373 |
<p>Consider improving your credit score, reducing existing debt, or applying with a co-applicant with higher income.</p>
|
374 |
</div>
|
375 |
""", unsafe_allow_html=True)
|
|
|
342 |
manual_rejection = False
|
343 |
rejection_reason = ""
|
344 |
|
345 |
+
# Rule-based rejections that override the model (but don't show to user)
|
346 |
if total_income < 1500:
|
347 |
manual_rejection = True
|
348 |
+
rejection_reason = "Insufficient income"
|
349 |
+
elif dti_percent > 50:
|
350 |
manual_rejection = True
|
351 |
+
rejection_reason = "Payment too high relative to income"
|
352 |
elif credit_history == 0 and dti_percent > 35:
|
353 |
manual_rejection = True
|
354 |
+
rejection_reason = "Credit history and payment factors"
|
355 |
|
356 |
# Final decision combines model prediction and manual eligibility checks
|
357 |
final_approval = (prediction[0] == 1) and not manual_rejection
|
|
|
369 |
<div class="result-rejected">
|
370 |
<h3 style="color: #C62828;">❌ Loan Not Approved</h3>
|
371 |
<p>Unfortunately, based on your current information, we cannot approve your loan application.</p>
|
|
|
372 |
<p>Consider improving your credit score, reducing existing debt, or applying with a co-applicant with higher income.</p>
|
373 |
</div>
|
374 |
""", unsafe_allow_html=True)
|