Implementation of the K-Nearest Neighbor Algorithm for Birth Rate Prediction
DOI:
https://doi.org/10.30871/jaic.v9i4.9886Keywords:
Birth Rate, Data Mining, Family Planning, K-Nearest Neighbor, Population PredictionAbstract
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
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
How to Cite
Issue
Section
License
Copyright (c) 2025 Akhyar Alhafiz, Rakhmat Kurniawan R.

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License (Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) ) that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).








