PERBANDINGAN ALGORITMA K-NEAREST NEIGHBOUR DAN NAÏVE BAYES UNTUK MENDETEKSI PENIPUAN KARTU KREDIT

Authors

  • Fauzan Firdaus Universitas Ibrahimy Sukorejo
  • Ahmad Homaidi Universitas Ibrahimy
  • Jarot Dwi Prasetyo Universitas Ibrahimy
  • Hermanto Hermanto Universitas Ibrahimy
  • Ach. Zubairi Universitas Ibrahimy
  • Lukman Fakih Lidimilah Universitas Ibrahimy

DOI:

https://doi.org/10.35316/jimi.v10i2.163-171

Keywords:

K-Nearest Neighbor, Naïve Bayes, Penipuan, Kartu Kredit

Abstract

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.

Downloads

Download data is not yet available.

References

[1] N. Report, “Card Fraud Losses Worldwide in 2023.” Accessed: Dec. 02, 2025. [Online]. Available: https://nilsonreport.com/articles/card-fraud-losses-worldwide-in-2023/

[2] S. M. Pais and S. Acharya, “Hybrid Algorithm for Naïve Bayes-Based Credit Card Fraud Detection,” 2021. doi: 10.1007/978-981-15-9873-9_36.

[3] R. O. Ogundokun, S. Misra, O. J. Fatigun, and J. K. Adeniyi, “Naïve Bayes Based Classifier for Credit Card Fraud Discovery,” in Lecture Notes in Business Information Processing, 2022. doi: 10.1007/978-3-030-95947-0_37.

[4] T. Vairam, S. Sarathambekai, S. Bhavadharani, A. Kavi Dharshini, N. Nithya Sri, and T. Sen, “Evaluation of Naïve Bayes and Voting Classifier Algorithm for Credit Card Fraud Detection,” in 8th International Conference on Advanced Computing and Communication Systems, ICACCS 2022, 2022. doi: 10.1109/ICACCS54159.2022.9784968.

[5] N. Samy and S. mohamed mohamed, “Credit Card Fraud Detection Using Machine Learning Techniques,” Future Computing and Informatics Journal, vol. 7, no. 1, 2022, doi: 10.54623/fue.fcij.7.1.2.

[6] A. Jessica, F. V. Raj, and J. Sankaran, “Credit Card Fraud Detection Using Machine Learning Techniques,” in ViTECoN 2023 - 2nd IEEE International Conference on Vision Towards Emerging Trends in Communication and Networking Technologies, Proceedings, 2023. doi: 10.1109/ViTECoN58111.2023.10157162.

[7] E. Tank and M. Das, “On Credit Card Fraud Detection Using Machine Learning Techniques,” in Lecture Notes in Networks and Systems, 2024. doi: 10.1007/978-981-97-2004-0_21.

[8] J. Chung and K. Lee, “Credit Card Fraud Detection: An Improved Strategy for High Recall Using KNN, LDA, and Linear Regression,” Sensors, vol. 23, no. 18, 2023, doi: 10.3390/s23187788.

[9] Jiwon Chung and Kyungho Lee, “Credit Card Fraud Detection: An Improved Strategy for High Recall Using KNN, LDA, and Linear Regression,” Sensors, vol. 23, no. 18, 2023.

[10] S. Said, M. Al Khadhori, A. Juma, K. Al Mukhaini, and V. Sherimon, “Machine Learning Approaches for Credit Card Fraud Detection: a Predictive Analysis,” International Journal of Artificial Intelligence & Machine Learning (IJAIML), vol. 3, no. 1, 2024.

[11] S. Baba Atiku and A. A. Unimke, “Machine Learning Approach to Detection of Credit Card Fraud,” International Journal of Applied Science and Research, vol. 08, no. 04, 2025, doi: 10.56293/ijasr.2025.6604.

[12] S. M. Ghatge, “Machine Learning Approach for Credit Card fraud Detection,” Int J Res Appl Sci Eng Technol, vol. 10, no. 5, 2022, doi: 10.22214/ijraset.2022.43587.

[13] P. N. Pote, “Credit Card Fraud Detection: A Machine Learning Approach,” INTERANTIONAL JOURNAL OF SCIENTIFIC RESEARCH IN ENGINEERING AND MANAGEMENT, vol. 08, no. 04, 2024, doi: 10.55041/ijsrem31981.

[14] A. Miah, “Credit Card Fraud Detection Dataset.” Accessed: Dec. 18, 2025. [Online]. Available: https://www.kaggle.com/datasets/miadul/credit-card-fraud-detection-dataset

[15] K. Arora, S. Pathak, and N. T. Dieu Linh, “Comparative Analysis ofK-Nn, Naïve Bayes, and logistic regression for credit card fraud detection,” Ingenieria Solidaria, vol. 19, no. 3, 2023, doi: 10.16925/2357-6014.2023.03.05.

[16] H. Wang and T. M. Khoshgoftaar, “Review of Feature Selection Techniques for Credit Card Fraud Detection,” in 28th ISSAT International Conference on Reliability and Quality in Design, RQD 2023, 2023.

[17] M. Pagan, M. Zarlis, and A. Candra, “Investigating the impact of data scaling on the k-nearest neighbor algorithm,” Computer Science and Information Technologies, vol. 4, no. 2, 2023, doi: 10.11591/csit.v4i2.pp135-142.

[18] P. J. Muhammad Ali, “Investigating the Impact of Min-Max Data Normalization on the Regression Performance of K-Nearest Neighbor with Different Similarity Measurements,” ARO-The Scientific Journal of Koya University, vol. 10, no. 1, 2022, doi: 10.14500/aro.10955.

[19] M. Baloch, M. S. Honnurvali, A. Kabbani, T. A. Jumani, and S. T. Chauhdary, “An Intelligent SARIMAX-Based Machine Learning Framework for Long-Term Solar Irradiance Forecasting at Muscat, Oman,” Energies (Basel), vol. 17, no. 23, 2024, doi: 10.3390/en17236118.

[20] I. K. Prasetya, D. P. Isnawarty, A. Fahmi, S. A. P. Andikaputra, and W. Wibawati, “Comparing the Performance of Multivariate Hotelling’s T2 Control Chart and Naive Bayes Classifier for Credit Card Fraud Detection,” Inferensi, vol. 7, no. 1, 2024, doi: 10.12962/j27213862.v7i1.18755.

[21] T. Rak, J. Drabek, and M. Charytanowicz, “Performance-Based Classification of Users in a Containerized Stock Trading Application Environment Under Load,” Electronics (Switzerland), vol. 14, no. 14, 2025, doi: 10.3390/electronics14142848.

[22] M. Aviles, L. M. Sánchez-Reyes, J. M. Álvarez-Alvarado, and J. Rodríguez-Reséndiz, “Machine and Deep Learning Trends in EEG-Based Detection and Diagnosis of Alzheimer’s Disease: A Systematic Review,” 2024. doi: 10.3390/eng5030078.

[23] S. Gupta, B. Kishan, and P. Gulia, “Comparative Analysis of Predictive Algorithms for Performance Measurement,” IEEE Access, vol. 12, 2024, doi: 10.1109/ACCESS.2024.3372082.

[24] D. Sharma, E. Kaur, N. Sharma, D. Rawat, S. P. Yadav, and M. Manwal, “Comparative Analysis of Machine Learning Algorithms on Credit Card Fraud Detection,” in 2025 International Conference on Cognitive Computing in Engineering, Communications, Sciences and Biomedical Health Informatics, IC3ECSBHI 2025, 2025. doi: 10.1109/IC3ECSBHI63591.2025.10990921.

Published

30-12-2025 — Updated on 14-01-2026

Versions

How to Cite

Firdaus, F., Homaidi, A., Prasetyo, J. D., Hermanto, H., Zubairi, A., & Lidimilah, L. F. (2026). PERBANDINGAN ALGORITMA K-NEAREST NEIGHBOUR DAN NAÏVE BAYES UNTUK MENDETEKSI PENIPUAN KARTU KREDIT. Jurnal Ilmiah Informatika, 10(2), 163–171. https://doi.org/10.35316/jimi.v10i2.163-171 (Original work published December 30, 2025)

Most read articles by the same author(s)