Comparison of Hyperparameter Tuning in Decision Tree and Random Forest Algorithms for Song Genre Classification

Authors

  • Anindita Maitsa Universitas Dian Nuswantoro
  • Nurul Annisa Winarsih Universitas Dian Nuswantoro

DOI:

https://doi.org/10.30871/jaic.v9i4.10142

Keywords:

Decision Tree, Hyperparameter Tuning, Music Genre Classification, Random Forest

Abstract

This research applies Decision Tree and Random Forest algorithms for music genre classification based on audio numerical features such as tempo, energy, loudness, and valence. The dataset used comes from Kaggle and consists of 7,958 song entries from eight genres. The data was processed through pre-processing stages that included duplication removal, empty value handling, normalization, outlier removal, and class balancing using the SMOTE technique. In the initial test, Random Forest showed an accuracy of 85%, higher than Decision Tree which recorded 76%. After hyper parameter tuning using GridSearchCV, Decision Tree's accuracy increased to 79%, while Random Forest experienced a slight decrease to 84%. This decrease does not reflect a decrease in performance, but rather a more balanced redistribution of predictions to minor classes, as reflected by the stable F1-score macro value at 0.84. In terms of efficiency, tuning the Random Forest took much longer (806.81 seconds) than the Decision Tree (17.42 seconds), indicating that model complexity has a direct impact on training time. These findings suggest that data quality, tuning strategy and time efficiency are important factors in building a reliable and balanced music genre classification system.

Downloads

Download data is not yet available.

References

[1] G. Ayu, V. Mastrika Giri, and L. Radhitya, “Musical Instrument Classification using Audio Features and Convolutional Neural Network,” 2024. [Online]. Available: http://jurnal.polibatam.ac.id/index.php/JAIC

[2] J. Elektronik, I. K. Udayana, I. L. Simarmata, W. Supriana, and S. Kuta, “Music Genre Classification Using Random Forest Model,” Jurnal Elektronik Ilmu Komputer Udayana, vol. 12, no. 1, pp. 2654–5101, 2023.

[3] Y. Wang and H. Chen, “An improved random forest model for music genre classification algorithm based on sparrow search algorithm,” Applied and Computational Engineering, vol. 77, no. 1, pp. 84–90, Jul. 2024, doi: 10.54254/2755-2721/77/20240658.

[4] Merry Royanti Manalua, Made Agung Raharjaa, and F. Matematika dan Ilmu Pengetahuan Alam, “Analisis dan Klasifikasi Genre Musik Menggunakan Algoritma STFT dan Random Forest,” JNATIA, vol. 3, no. 1, 2024.

[5] T. Pratiwi, A. Sunyoto, and D. Ariatmanto, “Music Genre Classification using K-Nearest Neighbor and Mel-Frequency Cepstral Coefficients,” Jurnal dan Penelitian Teknik Informatika, vol. 8, no. 2, 2024, doi: 10.33395/v8i2.12912.

[6] F. Fakhriza et al., “Optimalisasi Algoritma Random Forest Feature Selection Dan Hyperparameter Tuning Klasifikasi Genre Musik,” 2025. [Online]. Available: https://www.kaggle.com/datasets/maharshipa

[7] E. Helmud, E. Helmud, F. Fitriyani, and P. Romadiana, “Classification Comparison Performance of Supervised Machine Learning Random Forest and Decision Tree Algorithms Using Confusion Matrix,” Jurnal Sisfokom (Sistem Informasi dan Komputer), vol. 13, no. 1, pp. 92–97, Feb. 2024, doi: 10.32736/sisfokom.v13i1.1985.

[8] G. Pu, L. Wang, J. Shen, and F. Dong, “A Hybrid Unsupervised Clustering-Based Anomaly Detection Method.” [Online]. Available: http://creativecommons.org/licenses/by/4.0/

[9] Z. Jayidan, A. M. Siregar, S. Faisal, and H. Hikmayanti, “Improving Heart Disease Prediction Accuracy Using Principal Component Analysis (Pca) In Machine Learning Algorithms,” Jurnal Teknik Informatika (Jutif), vol. 5, no. 3, pp. 821–830, Jun. 2024, doi: 10.52436/1.jutif.2024.5.3.2047.

[10] N. T. Hastuti and F. Budiman, “Optimasi Klasifikasi Stunting Balita dengan Teknik Boosting pada Decision Tree,” Edumatic: Jurnal Pendidikan Informatika, vol. 8, no. 2, pp. 655–664, Dec. 2024, doi: 10.29408/edumatic.v8i2.27913.

[11] M. Arif, maruf Setiawan, A. Dwi Hartono, M. Arif Ma, and ruf Setiawan, “Menggunakan Metode Machine Learning Untuk Memprediksi Nilai Mahasiswa Dengan Model Prediksi Multiclass,” Jurnal Informatika: Jurnal pengembangan IT, vol. 10, no. 1, p. 2025, doi: 10.30591/jpit.v9ix.xxx.

[12] A. Nurhopipah and C. Magnolia, “Perbandingan Metode Resampling Pada Imbalanced Dataset Untuk Klasifikasi Komentar Program MBKM,” JUPIKOM, vol. 1, no. 2, 2022.

[13] E. Oktavianti, M. Agustin, and R. Sari, “Implementasi Algoritma Decision Tree Dengan Fitur Seleksi Weight By Information Gain,” 2023.

[14] R. N. Ramadhon, A. Ogi, A. P. Agung, R. Putra, S. S. Febrihartina, and U. Firdaus, “Implementasi Algoritma Decision Tree untuk Klasifikasi Pelanggan Aktif atau Tidak Aktif pada Data Bank,” 2024.

[15] R. Firdaus et al., “Implementasi Algoritma Random Forest Untuk Klasifikasi Pencemaran Udara di Wilayah Jakarta Berdasarkan Jakarta Open Data”.

[16] R. Hidayat et al., “Implementasi Algoritma Random Forest Regression Untuk Memprediksi Penjualan Produksi di Supermarket,” SIMKOM, vol. 10, no. 1, pp. 101–109, Jan. 2025, doi: 10.51717/simkom.v10i1.703.

[17] “Optimasi Hyperparameter Algoritma Support Vector Machine dalam Klasifikasi Penyakit β-Thalassemia.” [Online]. Available: https://www.researchgate.net/publication/389288132

[18] H. Mahmud Nawawi, A. Baitul Hikmah, A. Mustopa, and G. Wijaya, “Model Klasifikasi Machine Learning untuk Prediksi Ketepatan Penempatan Karir,” Jurnal SAINTEKOM, vol. 14, no. 1, pp. 13–25, Mar. 2024, doi: 10.33020/saintekom.v14i1.512.

[19] A. T. Setiawan, “Identifikasi Jenis Sampah Secara Otomatis Menggunakan Metode Convolutional Neural Network (CNN).”

[20] R. Fatmasari, W. Gata, N. Kusuma Wardhani, K. Prayogi, and M. Binti Husna, “Klasifikasi Sentimen Terhadap Kualitas Aplikasi Bahan Ajar Digital Akademik Universitas Terbuka di Google Play,” Jurnal SAINTEKOM, vol. 14, no. 1, pp. 48–60, Mar. 2024, doi: 10.33020/saintekom.v14i1.591.

[21] A. Carolina Wibowo, S. Ardi Lestari, S. Informasi, F. Ilmu Komputer, and U. Duta Bangsa Surakarta, “Analisis Penggunaan Machine Learning Dalam Klasifikasi Penentuan Penyakit Jantung,” vol. 9, no. 2, 2024.

Downloads

Published

2025-08-08

How to Cite

[1]
A. Maitsa and N. A. Winarsih, “Comparison of Hyperparameter Tuning in Decision Tree and Random Forest Algorithms for Song Genre Classification”, JAIC, vol. 9, no. 4, pp. 1825–1834, Aug. 2025.

Issue

Section

Articles

Similar Articles

1 2 3 4 5 > >> 

You may also start an advanced similarity search for this article.