Credit card fraud is a serious problem in the financial industry that continues to increase with the development of digital transaction technology. This study aims to compare the performance of the K-Nearest Neighbour (KNN) and Naive Bayes algorithms in detecting credit card fraud by considering various evaluation metrics evaluation metrics, including not only accuracy but also precision, recall, and F1-score. The dataset used was sourced from Kaggle, comprising a total of 10,000 transaction records, which included financial transaction attributes and user behaviour. The research process included data pre-processing, attribute selection, data normalisation, and the application of both algorithms using RapidMiner software. The test results showed that the KNN algorithm produced an accuracy of 98.43%, a precision of 98.53%, and a recall of 99.90%, while Naive Bayes obtained an accuracy 98.20% accuracy, 99.69% precision, and 98.48% recall. Although KNN showed slightly superior performance in detecting fraudulent transactions, the T-Test statistical test showed that the difference in performance between the two algorithms was not statistically significant. KNN has an advantage in recognising complex patterns, but requires greater computational time, while Naive Bayes is more efficient in terms of speed. This study concludes that the selection of a fraud detection algorithm needs to consider the trade-off between accuracy and computational efficiency according to system requirements.
Copyrights © 2025