Telematika
Vol 18, No 1: February (2025)

Comparative Analysis of Distance Metrics in KNN and SMOTE Algorithms for Software Defect Prediction

Maulidha, Khusnul Rahmi (Lambung Mangkurat University)
Faisal, Mohammad Reza (Lambung Mangkurat University)
Saputro, Setyo Wahyu (Lambung Mangkurat University)
Abadi, Friska (Lambung Mangkurat University)
Nugrahadi, Dodon Turianto (Lambung Mangkurat University)
Adi, Puput Dani Prasetyo (National Research and Innovation Agency (Badan Riset dan Inovasi Nasional))
Hariyady, Hariyady (Universiti Malaysia Sabah)



Article Info

Publish Date
27 Feb 2025

Abstract

As the complexity and scale of projects increase, new challenges arise related to handling software defects. One solution uses machine learning-based software defect prediction techniques, such as the K-Nearest Neighbors (KNN) algorithm. However, KNN’s performance can be hindered by the majority vote mechanism and the distance/similarity metric choice, especially when applied to imbalanced datasets. This research compares the effectiveness of Euclidean, Hamming, Cosine, and Canberra distance metrics on KNN performance, both before and after the application of SMOTE (Synthetic Minority Over-sampling Technique). Results show significant improvements in the AUC and F-1 measure values across various datasets after the SMOTE application. Following the SMOTE application, Euclidean distance produced an AUC of 0.7752 and an F1 of 0.7311 for the EQ dataset. With Canberra distance and SMOTE, the JDT dataset produced an AUC of 0.7707 and an F-1 of 0.6342. The LC dataset improved to 0.6752 and 0.3733 in tandem with the ML dataset, which climbed to 0.6845 and 0.4261 with Canberra distance. Lastly, after using SMOTE, the PDE dataset improved to 0.6580 and 0.3957 with Canberra distance. The findings confirm that SMOTE, combined with suitable distance metrics, significantly boosts KNN’s prediction accuracy, with a P-value of 0.0001.

Copyrights © 2025






Journal Info

Abbrev

TELEMATIKA

Publisher

Subject

Education

Description

Jl. Letjend Pol. Soemarto No.126, Watumas, Purwanegara, Kec. Purwokerto Utara, Kabupaten Banyumas, Jawa Tengah ...