In 2023, at Üsküdar American Academy, I wrote my IB Extended Essay in Computer Science on comparing the potential of using machine learning algorithms for credit risk assessment and loan approval in peer-to-peer lending platforms, and I went back and read it properly again this week since most of what I do now is evaluation.
The setup was the Lending Club dataset from Kaggle, 2,260,701 approved loans with 166 variables, 1.6 GB, so I processed it in chunks of 5,000 rows in Jupyter. Missing values were filled with KNN imputation (k = 5), a loan counted as a default if its status was charged off, late, in grace period or default (13.43% of all loans), XGBoost feature importance picked the feature subsets, and then I trained five models with sklearn defaults on an 80/20 split: logistic regression, a decision tree, a multilayer perceptron, an SVM and a probabilistic neural network.
The final table:
| Model | Accuracy | Recall | Precision | F1 | Runtime |
|---|---|---|---|---|---|
| Logistic regression | 87.10% | 87.32% | 86.93% | 87.12% | 6.2 s |
| SVM | 86.59% | 89.96% | 83.85% | 86.74% | 6,117 s |
| Decision tree | 80.68% | 81.49% | 80.33% | 80.91% | 8.8 s |
| MLP | 87.08% | 88.54% | 86.01% | 87.26% | 300.8 s |
| PNN | 86.53% | 88.11% | 85.41% | 86.75% | 3,000 s |
Reading it now, there are things I would not let through anymore:
- The text and the table say different things. The conclusion says the SVM leads with an accuracy approaching 89.4% and the best precision, but in my own table logistic regression has the best accuracy, the SVM has worse precision than everything except the decision tree, and it took about a thousand times longer than logistic regression to run. The text even mentions an "RF" model that I never trained. Somewhere between drafts the writing and the numbers drifted apart and I did not check one against the other.
- The top features were leaking the answer. The most important features were the last FICO range, the last payment amount and the last payment date, which are things you only know after the loan has already played out. At approval time none of them exist, so the ~87% is more about how well the model reads the ending of a loan than how well it predicts one.
- The test set was balanced. Real defaults were 13.43%, but both splits were close to 50/50, so the accuracy numbers say very little about how any of these models would behave on the real distribution.
I didn't see any of this at 17, and it is basically the same problem I work on now with LLM judges, where if the metric is not measuring what you think it measures, everything built on top of it looks fine and means nothing. I am keeping the essay as it was.