An investigation on credit card fraud detection using machine learning
In this article we will analyze how various machine learning algorithms perform on balance and unbalance dataset by taking example of…
An investigation on credit card fraud detection using machine learning
In this article we will analyze how various machine learning algorithms perform on balance and unbalance dataset by taking example of credit card fraud detection.

Credit card fraud detection using machine learning
INTRODUCTION
In the past few years machine learning has played a crucial role in resolving various problems of the businesses like spam detection, recommendation, object detection etc. Fraud detection has been a painful task for the banking, medical, and commerce industry. Hackers and criminals are continuously working on new ways to find loopholes in the system as a result it is becoming more and more difficult for the companies to authenticate their transaction. According to the Fraud Benchmark Report by cyber source 83% American businesses are conducting manual reviews, and on an average basis, they review 29 % of orders manually. India is witnessing a drastic change to online transactions. It was ranked in top 5 countries with respect to credit card fraud and cases related to debit/credit card fraud have surged to 42% in 2017 according to the Hindustan Times. According to RBI data, the number of credit cards rose by a quarter upto 38 million in the last 12 months ending in May, while the number of debit cards jumped 17% to over 925 million in the same period.
MOTIVATION
There are many problems with manual review in credit card fraud detection like it is costly, time-consuming and lead to high false positives which means denying a normal user for the transaction completely. By analyzing machine learning algorithms in this area, my main job is to reduce human time, computation and effort. Artificial Intelligence helps machines to identify and extend the importance of patterns in place of humans by visualizing and analyzing the data on the basis of dataset provided and taking appropriate action on the basis of feature set in a short duration of time. Traditional approaches like rule based and traditional approaches have failed due to increase in data and more variation in types of transaction. Also one of the drawback is that due to high false positive rate it leads to loss of legitimate customers and high unbalance dataset is still a matter of concern and also a wide area of research in machine learning.
OBJECTIVE
The aim of this work is to study and analyze how machine learning algorithms like boosting and ensembling along with data balancing algorithms like smote, adasyn and allknn perform on fraud detection problems on unbalance and balance datasets.
DATASET DESCRIPTION
The dataset contains 284,807 transactions among which there are 492 i.e., 0.172% transactions are fraudulent transactions. It also contains transactions made by a cardholder in 2 days in month of september 2013 This dataset is highly unbalanced. Due to security reasons, most of the features in the dataset are transformed using principal component analysis (PCA). V1, V2, V3,…, V28 are PCA applied features and rest features include ‘time’, ‘amount’ and ‘class’ are non-PCA applied features.
METRICS USED
- Accuracy = TP + TN / TP + TN + FP + FN
- Precision = TP / TP + FP
- Recall = TP / TP + FN
- F1score = 2 precision recall / precision + recall
- Mcc = TP TN — FP FN / sqrt((TP + FP) (TP + FN) (TN + FP) * (TN + FN))
- Roc = Area under curve between false positive rate and true positive rate
RESULTS
The results of the investigation can be viewed here:
CONCLUSION
The overall project discusses the problem of credit card fraud detection and how machine learning can be used to deal with it. As stated in methodology various machine learning algorithms are compared on the basis on accuracy, precision, recall, f1score, roc and mcc. During the study while comparing various metrics for various machine learning it was found that highest accuracy was observed for xgboost using allknn, highest recall was observed for logistic regression with minmaxscaler [23] using allknn, highest precision and f1-score was observed for xgboost using allknn, highest roc and mcc score was observed for logistic regression using smote. Some results were quite an anomaly when compared to others like overall minmaxscaler doesn’t improve the model performance instead it showed down tread when used with logistic regression in terms of smote and adasyn it shown negative mcc score, value of zero for precision, recall, f1score when used with smote. On further observation true positive was found to be zero for logistic regression with smote and adasyn, true negative and false negative for logistic regression with minmaxscaler and logistic regression with minmaxscaler along with allknn is found to be 0. During analysis ’V14’ is found to be the most dominating feature when smote and adasyn are used as data balancing algorithm, also both of them are oversampling method, ’V17’ is found to be the most dominating feature when no data balancing algorithm is used. Most variation was observed in case of allknn as data balancing algorithm.
For any query please leave a comment below. Any further suggestions are welcomed.
메타데이터
- post_id
- eacdd2d5cb
- slug
- an-investigation-on-credit-card-fraud-detection-using-machine-learning-eacdd2d5cb
- url
- https://medium.com/analytics-vidhya/an-investigation-on-credit-card-fraud-detection-using-machine-learning-eacdd2d5cb
- canonical_url
- https://medium.com/analytics-vidhya/an-investigation-on-credit-card-fraud-detection-using-machine-learning-eacdd2d5cb
- author_url
- https://medium.com/@vj_jainy
- status
- ok
- fetched_at
- 2026-07-28 14:48:56