ML

Company Bankruptcy Prediction

AI early-warning system for financial distress — XGBoost AUC 0.9367 across 6,819 companies and 94 financial features including Altman Z-Score inspired ratios.

ML
📊

0.9367

XGBoost AUC

6,819

Companies Analysed

94

Financial Features

4

ML Models Tested

The Problem

Bankruptcy causes massive financial losses for investors, creditors, and employees. Traditional analysis is slow, manual, and reactive — catching problems too late. With only 220 bankrupt companies out of 6,819 (3.22%), the severe 30:1 class imbalance makes this a particularly hard detection problem. A data-driven model can flag at-risk companies months before collapse.

The Solution

Prepared 6,819 company records (94 numeric features, zero missing values). Added 4 Altman Z-Score inspired engineered features: Working Capital, Debt-to-Assets, Retained Earnings, and CashFlow-to-Debt ratios. Applied IQR-based outlier clipping, StandardScaler normalisation, and class-weight balancing (30:1). Trained 4 models (Logistic Regression, XGBoost, LightGBM, CatBoost) with 5-fold stratified CV. XGBoost achieved the best standalone AUC of 0.9367; a Logistic Regression meta-model stacking all 4 base predictions reached AUC 0.923. Threshold optimised to 0.365 to balance precision and recall on the minority bankrupt class.

Results & Metrics

  • XGBoost AUC of 0.9367 — well above the 0.80 industry standard for financial distress models
  • 109 of 220 bankrupt companies correctly flagged (49.5% recall at optimised threshold 0.365)
  • 97% of 6,599 healthy companies correctly classified — 6,501 of 6,599 correct
  • Top signal: Total income/Total expense ratio (20.49% importance) — spending more than earning is the strongest bankruptcy signal
  • Leverage ratios (Debt ratio, Total debt/Net worth, Equity-to-Liability) account for ~30% of model importance combined
  • 4 Altman Z-Score inspired features engineered on top of 94 raw financial ratios

Tech Stack

XGBoostLightGBMCatBoostscikit-learnStandardScalerPandasPython