slide deck · read the case study · try the app ↗
← → to move · N for notes · Ctrl+P for PDF
Nine I Missed
01 / 14Predicting corporate bankruptcy from 95 financial ratios · Taiwan Economic Journal, 1999–2009
44 bankrupt companies in the test set · 35 caught · 9 missed
BankruptSense · Prashant Singh · bankruptsense.app
One miss costs ten false alarms
02 / 14| Mistake | What actually happens | Cost (assumed) |
|---|---|---|
| Missed bankruptcy | the loan is written off | 10 |
| False alarm | an analyst spends an afternoon on a healthy firm | 1 |
- 6,819 listed Taiwanese companies · 220 went bankrupt.
- Held-out test portfolio: 1,364 companies, 44 of which will fail.
BankruptSense · Prashant Singh · bankruptsense.app
Everything here is a trade between two mistakes. I assumed a miss is ten times worse than a false alarm, and that one number drives every decision, including the threshold. The question by the end isn't how accurate the model is, but what each mistake cost.
96.8% accurate. Catches zero.
03 / 14
| “Always healthy” | Predicted healthy | Predicted bankrupt |
|---|---|---|
| Healthy | 1,320 | 0 |
| Bankrupt | 44 | 0 |
- Imbalance ≈ 30 : 1.
- Cost at 10 : 1 → 440. The do-nothing bill to beat.
- Accuracy is banned: rank with PR-AUC, decide with recall and false-alarm count.
BankruptSense · Prashant Singh · bankruptsense.app
The feature with a −0.02 correlation came out #1
04 / 14bankruptcy rate by quintile of interest rate on debt
- Pearson correlation −0.023: ranks 58th of 95 in a correlation screen.
- Yet it is the model's #1 feature, and risk rises 12× from cheapest to most expensive debt.
- A few ~1e9 values in a column whose typical value is ~0.0003 swamp the linear correlation. Ranks and trees aren't fooled.
BankruptSense · Prashant Singh · bankruptsense.app
A correlation filter would have thrown away the best variable. By quintile the pattern is plain: firms paying the most for debt fail twelve times as often. Lenders charge more to firms they already think are risky, so this column holds the market's opinion.
Two things I refused to throw away
05 / 14| “Dirty” data | Tempting move | What the data said | What I did |
|---|---|---|---|
| 131 rows with ~9.99e9 values in 13 columns | delete the rows | 16.8% go bankrupt vs 3.0% | set to missing, impute median, count them → n_anomalies |
| Outliers (30 columns >10% IQR outliers) | trim them | the outliers are the distressed firms | cap at 1st/99th pct for linear models; keep every row |
The very-high-debt band holds 164 of 220 bankruptcies (75%): a 12.7% rate against 0.3% in the low-debt band.
BankruptSense · Prashant Singh · bankruptsense.app
Fighting 30 : 1 without inventing data
06 / 14- Class weights: each bankrupt firm counts ~30× in training.
- SMOTE, applied inside each CV fold, was tested and not adopted.
- Stratified 80/20 split and stratified 5-fold CV, so every fold has bankruptcies.
| CV PR-AUC | Class weights | + SMOTE |
|---|---|---|
| Logistic Regression | 0.379 | 0.349 |
| LightGBM | 0.445 | 0.458 |
Fold-to-fold noise ≈ ±0.06: the changes go both ways and are smaller than the noise.
BankruptSense · Prashant Singh · bankruptsense.app
Eight models, one decision
07 / 14
LightGBM, tuned: 0.480. Best PR-AUC, and copes with 1e9-scale garbage and near-duplicate features.
what I deliberately did not do
- optimise accuracy
- use the 0.5 threshold
- use SMOTE in the final model
- delete outlier rows
- look at the test set early
- use deep learning on 176 positives
BankruptSense · Prashant Singh · bankruptsense.app
Boosted trees finish within about 0.04 PR-AUC of each other, inside the noise. The honest message is 'boosted trees beat linear models'. Every item on the right is a shortcut that would have improved a number while making the model worse for the bank.
Same model, two thresholds: 18 caught vs 35 caught
08 / 14
| Threshold | Caught | False alarms |
|---|---|---|
| 0.5 (default) | 18 / 44 | 18 |
| 0.011 (chosen) | 35 / 44 | 73 |
- Chosen on out-of-fold training predictions. F2-optimal 0.011 and 10 : 1-cost optimum 0.009 agree.
- Scores rank well but aren't calibrated probabilities.
BankruptSense · Prashant Singh · bankruptsense.app
35 caught. 73 false alarms.
09 / 14- Review queue: 108 of 1,364 firms (7.9%).
- 1 in 3 flagged firms really fails (precision 32%) vs a 3.2% base rate: a 10× lift.
- Recall 80%; with only 44 failures the 95% interval is roughly 65–89%.
BankruptSense · Prashant Singh · bankruptsense.app
Read it as a workload: 108 files instead of 1,364, and one in three is a real bankruptcy. The price is 73 wasted reviews and 9 losses not seen. The interval is on the slide on purpose: with 44 positives, 80% could be anywhere from about 65 to 89.
Baseline vs LightGBM: same catch, half the noise
10 / 14| Same test set | Logistic Regression | LightGBM (final) |
|---|---|---|
| Bankruptcies caught | 36 / 44 (82%) | 35 / 44 (80%) |
| False alarms | 156 | 73 (−53%) |
| Firms to review | 192 | 108 |
| Precision | 19% | 32% |
| PR-AUC | 0.40 | 0.57 |
| Cost at 10 : 1 | 236 | 163 (−31%) |
The one-company gap in recall is noise. The gain is 83 healthy firms no longer pulled into review.
BankruptSense · Prashant Singh · bankruptsense.app
What the model looked at
11 / 14- 01 →
Lenders charge more
interest rate on debt (#1)
- 02 →
Overall health is weak
Altman-Z proxy (#2, engineered): 3.83 vs 4.24
- 03 →
The cushion is thin
quick ratio (#3): 0.0027 vs 0.0075
- 04 →
Debt meets losses
debt × loss (#4, engineered): 0.043 vs 0.020
Medians, bankrupt vs healthy. Two of the top four are features I built from classic credit analysis. Ranked by permutation importance (drop in test PR-AUC).
BankruptSense · Prashant Singh · bankruptsense.app
The nine I missed look healthy on paper
12 / 14| Median | Caught (35) | Missed (9) | Healthy (1,320) |
|---|---|---|---|
| Debt ratio | 0.200 | 0.132 | 0.106 |
| Altman-Z proxy | 3.72 | 4.03 | 4.26 |
| Very-high-debt band | 28 of 35 | 2 of 9 | — |
| Data anomalies | — | 0 | — |
| Model score | 0.56 | ≤ 0.005 | — |
- Not near-misses: every one scored below half the threshold.
- Profile: below-average profits, ordinary debt, clean data. “Quiet decliners”.
- 369 healthy firms (28%) share that profile.
- Catching them needs new information, not a better algorithm.
BankruptSense · Prashant Singh · bankruptsense.app
The model didn't nearly catch these nine; it was confidently wrong. They are mildly unprofitable but not heavily indebted, and 369 healthy companies look the same. Lowering the threshold would bury the review team.
If I had to ship this tomorrow
13 / 14Threshold 0.011 → review ~8% of the book each quarter.
| Caught | False alarms |
|---|---|
| 35 / 44 (now) | 73 |
| 41 / 44 | 169 |
| 44 / 44 | 373 (5×) |
- Watch the flag rate: a jump means drift, not a collapse.
- Record every flag's and miss's outcome; retrain yearly.
- Never quote the score as a probability.
- Residual risk: ~1 in 5 bankruptcies unflagged; 44 test failures; Taiwan 1999–2009 data.
BankruptSense · Prashant Singh · bankruptsense.app
Did I predict bankruptcy, or read the lenders' mind?
14 / 14The strongest signal was the interest rate lenders were already charging. The firms I missed were charged less than the ones I caught, so the lenders didn’t see them coming either.
Can a model built only on annual ratios beat the market’s own price of risk, or is about 80% recall the ceiling for this kind of data?
BankruptSense · Prashant Singh · bankruptsense.app