Credit card fraud detection is a typical rare-event classification problem because fraudulent transactions usually account for only a very small proportion of all transactions. Conventional evaluation on balanced or resampled test data may lead to overly optimistic performance estimates. To address this issue, this study proposes a leakage-safe credit card fraud detection framework integrating Random Forest Gini impurity-based feature selection, resampling strategy evaluation, and Genetic Algorithm (GA)-based hyperparameter optimization. The framework was evaluated on the public European credit card fraud dataset containing 284,807 transactions, of which only 492 were fraudulent. The original dataset was first divided into a stratified training set and an untouched original-distribution test set. Feature selection, standardization, resampling, GA optimization, and threshold tuning were performed only on the training data or training folds. The final test set contained 85,443 transactions, including 148 fraudulent transactions, and was used only once for final evaluation. Experimental results show that GA-XGBoost achieved the best overall balance among the optimized models, with a PR-AUC of 0.798, ROC-AUC of 0.967, MCC of 0.814, balanced accuracy of 0.865, fraud-class precision of 0.908, fraud-class recall of 0.730, and fraud-class F1-score of 0.809. Compared with baseline XGBoost, GA-XGBoost improved PR-AUC from 0.741 to 0.798, MCC from 0.766 to 0.814, and fraud-class F1-score from 0.764 to 0.809, while reducing false positives from 22 to 11 and false negatives from 43 to 40. The ablation results further indicate that resampling strategies are not universally beneficial and should be evaluated under the original test distribution. These findings suggest that leakage-safe evaluation and fraud-class-oriented metrics provide a more reliable basis for practical credit card fraud detection.
Ma et al. (Sun,) studied this question.