Implementation of the K-Nearest Neighbor Algorithm for Birth Rate Prediction

Authors

  • Akhyar Alhafiz Sistem Informasi, Universitas Islam Negeri Sumatera Utara Medan
  • Rakhmat Kurniawan R. Sistem Informasi, Universitas Islam Negeri Sumatera Utara Medan

DOI:

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

Keywords:

Birth Rate, Data Mining, Family Planning, K-Nearest Neighbor, Population Prediction

Abstract

This study aims to predict the monthly birth rate using the K-Nearest Neighbor (KNN) regression algorithm. The dataset consists of historical data from 2010 to 2020, covering six districts and including variables such as total population, number of couples of reproductive age, family planning participation rate, and monthly birth rate as the prediction target. Data preprocessing involved handling missing values and applying Min-Max normalization. To maintain the time-series nature of the data, a chronological split was used, with 576 records from 2010 to 2018 for training and 216 records from 2019 to 2020 for testing. The model was evaluated using Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and R-squared (R²). The best performance was achieved at K = 7, with MAE = 19.94, RMSE = 30.91, and R² = 0.34. Additionally, the KNN model was compared with Linear Regression and Decision Tree, where KNN outperformed both alternatives. The final model was implemented in a web-based application to facilitate demographic data management and automatic birth rate prediction per district. This system is expected to support policy planning in the fields of population control and public health.

Downloads

Download data is not yet available.

References

[1] D. S. Seruni, M. T. Furqon, and R. C. Wihandika, “Sistem Prediksi Pertumbuhan Jumlah Penduduk Kota Malang menggunakan Metode K-Nearest Neighbor Regression,” 2020. [Online]. Available: http://j-ptiik.ub.ac.id

[2] Sensus Penduduk, “Berita Resmi Statistik Hasil Sensus Penduduk 2020.”

[3] Kementrian Kesehatan, “Rendahnya partisipasi pria dalam program keluarga berencana (KB).”

[4] BPS, “Kota Tanjung Balai Dalam Angka 2023.”

[5] N. Wulandari, Y. Cahyana, and H. Hikmayanti Handayani, “Sentiment Analysis on the Relocation of the National Capital (IKN) on Social Media X Using Naive Bayes and K-Nearest Neighbor (KNN) Methods,” 2025. [Online]. Available: http://jurnal.polibatam.ac.id/index.php/JAIC

[6] S. Triase, “Implementasi Data Mining Dalam Mengklasifikasikan Ukt (Uang Kuliah Tunggal) Pada Uin Sumatera Utara Medan,” Jurnal Teknologi Informasi, vol. 4, no. 2, 2020.

[7] V. Syafana, S. S. Hilabi, E. Novalia, and B. Huda, “Prediksi Angka Kelahiran dalam Berbagai Kelompok Umur Ibu Menggunakan Metode K-Nearest Neighbor,” MALCOM: Indonesian Journal of Machine Learning and Computer Science, vol. 4, no. 3, pp. 1096–1103, Jul. 2024, doi: 10.57152/malcom.v4i3.1392.

[8] Sutrimo and D. Wismarini, “Prediksi Proses Persalinan Menggunakan Algoritma Knn Berbobot Pada Monitoring Elektronik Personal Health Record Ibu Hamil,” 2022.

[9] M. Qibtiyah and N. Cahyani, “Prediksi Tingkat Kelahiran Bayi di Kabupaten Bojonegoro dengan Menggunakan Algoritma Naive Bayes,” 2024.

[10] D. Puspita Sari, S. Shofia Hilabi, and Agustia Hananto, “Penerapan Data Mining Metode K-Nearest Neighbor Untuk Memprediksi Kelulusan Siswa Sekolah Menengah Pertama,” SMARTICS Journal, vol. 9, no. 1, pp. 14–19, Mar. 2023, doi: 10.21067/smartics.v9i1.8088.

[11] M. A. R. Habibi, S. S. Hilabi, B. Priyatna, and E. Novalia, “Penerapan Metode K-Nearest Neighbor Untuk Prediksi Jumlah Kasus HIV di Provinsi Jawa Barat,” JTIM : Jurnal Teknologi Informasi dan Multimedia, vol. 7, no. 2, pp. 372–386, May 2025, doi: 10.35746/jtim.v7i2.721.

[12] S. J. A. B. Bukit and R. K. R., “Prediksi Harga Tandan Buah Segar dengan Algoritma K-Nearest Neighbor,” Jurnal Sistem Komputer dan Informatika (JSON), vol. 5, no. 1, p. 92, Sep. 2023, doi: 10.30865/json.v5i1.6818.

[13] A. Agung, A. Daniswara, I. Kadek, and D. Nuryana, “Data Preprocessing Pola Pada Penilaian Mahasiswa Program Profesi Guru,” Journal of Informatics and Computer Science, vol. 05, 2023.

[14] R. Hidayatullah, D. Abdul Fatah, A. Yasid, J. Raya Telang, K. Kamal, and J. Timur, “Penerapan Algoritma K-Nearest Neighbor Pada Minat Beli Mobil Bekas Menggunakan Pendekatan CRISP-DM,” 2025.

[15] M. Diki Hendriyanto and N. Sari, “Penerapan Algoritma K-Nearest Neighbor Penerapan Algoritma K-Nearest Neighbor dalam Klasifikasi Judul Berita Hoax,” 2022.

[16] Z. Hadiansyah, Z. Rozikin, and M. Fatchan, “Implementasi Algoritma K-Nearest Neighbor dalam Klasifikasi Penyakit Kanker Paru Paru,” Journal of Computer System and Informatics (JoSYC), vol. 6, no. 1, pp. 96–106, Nov. 2024, doi: 10.47065/josyc.v6i1.6195.

[17] D. Septiani and A. Susanto, “Implementasi Decision Tree untuk Prediksi Kebutuhan Bahan Kain Pada Usaha Konveksi,” 2025.

[18] M. Radhi, D. Ryan Hamonangan Sitompul, S. Hamonangan Sinurat, and E. Indra, “Analisis Big Data Dengan Metode Exploratory Data Analysis (Eda) Dan Metode Visualisasi Menggunakan Jupyter Notebook,” Jurnal Sistem Informasi dan Ilmu Komputer Prima, vol. 4, no. 2, 2021.

[19] M. Husni Mubarok and F. Septian, “Prediksi GDP dengan RF dan XGBoost Berdasarkan Aspek Sosial, Ekonomi, dan Lingkungan,” 2025.

Downloads

Published

2025-08-05

How to Cite

[1]
A. Alhafiz and R. Kurniawan R., “Implementation of the K-Nearest Neighbor Algorithm for Birth Rate Prediction”, JAIC, vol. 9, no. 4, pp. 1441–1450, Aug. 2025.

Issue

Section

Articles

Similar Articles

1 2 3 4 5 > >> 

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