Comparative Analysis of K-Nearest Neighbor (KNN) and Decision Tree Algorithms in Predicting Student Academic Performance

Authors

  • Muhammad Iqbal Tsabitul Azmi STMIK AMIKOM Surakarta
  • Dimas Andreas Musthofa STMIK Amikom Surakarta
  • Aldo Paristiyo STMIK Amikom Surakarta
  • Muh. Rizky Perdana STMIK Amikom Surakarta
  • Muhammad Hanif K STMIK Amikom Surakarta
  • Tommy Dwi Putra STMIK Amikom Surakarta

Keywords:

Class Imbalance, Decision Tree, Educational Data Mining, K-Nearest Neighbor, Performance Prediction

Abstract

Predicting students' academic performance is essential for identifying learning needs and providing timely educational interventions. Although various machine learning algorithms have been applied in Educational Data Mining (EDM), comparative studies evaluating their performance on datasets that integrate both academic and non-academic factors remain limited. This study aims to compare the performance of the K-Nearest Neighbor (KNN) and Decision Tree algorithms in predicting students' academic achievement using the publicly available Student Performance Dataset from Kaggle. A quantitative experimental approach was employed by applying data preprocessing, feature scaling for KNN, and an 80:20 train–test split. Model performance was evaluated using Accuracy, Precision, Recall, and F1-Score metrics. The experimental results demonstrate that the Decision Tree algorithm significantly outperformed KNN, achieving an accuracy of 91.65% and a weighted F1-Score of 91.44%, whereas KNN obtained an accuracy of 62.00% and a weighted F1-Score of 60.74%. The superior performance of Decision Tree indicates its ability to model complex relationships among academic and non-academic variables while being more robust to class imbalance. These findings provide empirical evidence that Decision Tree is a more suitable algorithm for developing an interpretable and reliable early warning system to support academic decision-making and student performance monitoring in educational institutions.

Downloads

Published

2026-08-31

Issue

Section

Articles