Jurnal Media Computer Science
Vol 5 No 4 (2026): Oktober

Comparison of K-Nearest Neighbor and Naive Bayes Algorithms for Vocational High School 4 Padang Student’s Majoring Specialization

Ryan Firmansyah (Universitas Putra Indonesia YPTK Padang)
Agung Ramadhanu (Universitas Putra Indonesia YPTK Padang)
Billy Hendrik (Universitas Putra Indonesia YPTK Padang)



Article Info

Publish Date
27 Oct 2026

Abstract

Determining a student's major of specialization at State Vocational High School (SMKN) Negeri 4 Padang is still done subjectively, so there is a risk of causing inaccurate placement which has an impact on student learning achievement. A Data Mining approach is needed to analyze academic grade patterns in a structured and objective manner to support majoring decisions. This research aims to implement and compare the performance of the K-Nearest Neighbor (KNN) algorithm and the Naive Bayes Classifier in predicting students' majors. The research method applies a standard preprocessing approach, which includes data cleaning, normalization, and training-test data sharing. The classification model was then evaluated using the Stratified 5-Fold Cross Validation and Confusion Matrix methods to assess the accuracy and reliability of predictions. The dataset consists of 68 records of SMKN 4 Padang students with five core subject variables and three target major specialization classes. Experimental results show that the Naive Bayes Classifier produces superior performance with an average total accuracy of 64.71%. Meanwhile, the K-Nearest Neighbor algorithm (K=12) obtained an accuracy of 47.06%. The contribution of this research can provide an automated decision support system model based on objective academic data for schools in determining major interest.

Copyrights © 2026






Journal Info

Abbrev

jmcs

Publisher

Subject

Computer Science & IT

Description

Jurnal Media Computer Science merupakan jurnal nasional yang diterbitkan oleh Universitas Dehasen Bengkulu sejak tahun 2022. Jurnal Media Computer Science memuat artikel hasil-hasil penelitian di bidang Komputer, Sistem Informasi dan Teknologi. Jurnal Media Computer Science berkomitmen untuk menjadi ...