Project README
Review the project background, objectives, methodology and key information.
Read the READMEInvestigating machine learning approaches for identifying fraudulent transactions in a highly imbalanced dataset, where fraud represents only a very small proportion of transaction activity.
This case study explores how machine learning can distinguish legitimate credit card transactions from fraudulent ones. The central challenge is severe class imbalance: a model can achieve high overall accuracy by predicting the majority class while failing to identify fraud. The project therefore focuses on data preparation, imbalance-handling strategies, model comparison and threshold selection, with particular attention to precision, recall and the trade-off between false alarms and missed fraud.
Access the project documentation, analytical notebook and source code.
Review the project background, objectives, methodology and key information.
Read the READMEExplore the data preparation, imbalance strategies, model experiments and evaluation.
View the notebookInspect the project source files and implementation in the repository.
Open GitHub repositoryThe project follows a structured classification workflow, with safeguards to keep model selection separate from final test evaluation.
Remove duplicate records, prepare model features and scale numerical data using training data to help prevent data leakage.
Compare random oversampling, SMOTE, ADASYN, undersampling, Edited Nearest Neighbours and class weighting.
Compare classification approaches using precision, recall and F1-score, then tune the XGBoost model with Optuna.
Select a decision threshold using the validation precision-recall curve, then evaluate the selected model on the held-out test set.
XGBoost produced the strongest overall validation results among the approaches evaluated. The final test results show why performance must be assessed beyond accuracy.
On the held-out test set, the selected model achieved 98.6% precision and 72.6% recall, with an F1-score of 0.836.
This means that most transactions flagged as fraud were genuinely fraudulent, while the model still missed some actual fraud cases. Threshold selection improved the validation precision-recall balance, but test recall was lower than validation recall.
The findings highlight the practical trade-off between false alarms and missed fraud in a highly imbalanced classification problem.