In credit card fraud detection there is severe class imbalance, as less than 0.2 per cent of transactions are fraudulent. A reproducible pipeline for fraud detection was developed. Three gradient-boosted tree models (XGBoost, LightGBM and CatBoost) were tuned with Tree-structured Parzen Estimator search in Optuna on fixed stratified folds, and their predicted probabilities were averaged. The ensemble was deployed as a Flask API that returns SHapley Additive exPlanations (SHAP) with each prediction. The ensemble achieved an area under the precision-recall curve of 0.8481 under cross-validation on the European credit card benchmark, and 0.8192 on a 15 per cent holdout that was excluded from model fitting but not from hyperparameter and threshold selection. Replaying 56,746 out of-fold transactions through the live API reproduced every offline decision, and a prediction with its explanation was produced in about 76 milliseconds on a laptop CPU. It was found that the ensemble did not improve on the best individual model, and that a GraphSAGE autoencoder on a nearest-neighbour graph of transactions performed worse than a similar autoencoder that does not use the graph.
发表评论