Application of the K-Nearest Neighbor Algorithm for Rainfall Prediction Based on Weather Conditions

Authors

  • Nita Cahyani Universitas Padjadjaran
  • Rahmat Irsyada Politeknik Negeri Subang

DOI:

https://doi.org/10.31004/joecy.v6i2.13702

Keywords:

Data Mining, Prediction, Weather, Rainfall, K-Nearest Neighbor.

Abstract

ABSTRACT

Weather and climate patterns in Indonesia are often erratic and difficult to predict. Sometimes, rain fails to fall during the rainy season, while conversely, heavy rains—sometimes leading to flooding—occur during the dry season. Such situations can cause hardship for the community; for instance, during the dry season, farmers may plant crops that require little water—such as tobacco—which are generally unsuitable for cultivation during the rainy season. Research based on BMKG data indicates that rainfall occurs during July and August, while the dry season begins in May and June. To address these issues, scientific prediction can be employed by analyzing actual or historical data; this involves a process of analyzing current data to forecast future events, utilizing data mining for prediction and the K-Nearest Neighbor (K-NN) algorithm for classification. The research model in this thesis employs a development methodology covering software design, modeling, construction, and system delivery to the end-user. The system development follows the Waterfall model. The Weather Prediction System utilizes the K-Nearest Neighbor algorithm—implemented via PHP, MySQL, and RapidMiner—to facilitate future rainfall prediction. Data mining calculations regarding factors influencing rainfall using the K-NN method (with a 70:30 training-to-testing data ratio) yielded the following accuracy results: 98.87% for K=3, 97.30% for K=5, and 97.16% for K=7. Consequently, the use of the K-Nearest Neighbor method for prediction can assist in resolving these issues.

References

Hairunisa H. Analisis Dampak Musim Hujan Terhadap Hasil Panen Tomat di Desa Ciloto , Kabupaten Cianjur , Provinsi Jawa Barat. 2020;101.

Dasanto BD, Sulistiyanti S, Anria A, Boer R. Dampak Perubahan Iklim Terhadap Kenaikan Muka Air Laut Di Wilayah Pesisir Pangandaran. Risal Kebijak Pertan DAN Lingkung Rumusan Kaji Strateg Bid Pertan dan Lingkung. 2022;9(2):82–94.

Ruslana ZN, Giarno G. Edukasi Petani Dalam Memanfaatkan Informasi dan Prakiraan Iklim/Musim Melalui Sekolah Lapang Iklim di Tegalsari, Kedu, Temanggung. JEPKM J Edukasi dan Pengabdi …. 2022;1(2):41–51.

Zai C. Implementasi Data Mining Sebagai Pengolahan Data. Portal Data. 2022;2(3):1–12.

Salsabila A, Yunita R, Rozikin C. Identifikasi Citra Jenis Bunga menggunakan Algoritma KNN dengan Ekstrasi Warna HSV dan Tekstur GLCM. Technomedia J. 2021;6(1):124–37.

Praja AB, Darmansah D, Wijayanto S. Sistem Informasi Pencatatan Surat Masuk dan Surat Keluar Berbasis Website Menggunakan Metode Waterfall. J Sist Komput dan Inform. 2022;3(3):273.

Eprilianto DF, Sari YEK, Saputra B. Mewujudkan Integrasi Data Melalui Implementasi Inovasi Pelayanan Kesehatan Berbasis Teknologi Digital. JPSI (Journal Public Sect Innov. 2019;4(1):30.

Simbolon PH. Implementasi Data Mining Pada Sistem Persediaan Barang Menggunakan Algoritma Apriori ( Studi Kasus : Srikandi Cash Credit Elektronic dan Furniture ). J Ris Komput. 2019;6(4):401–6.

Sudrajat RT, Firmansyah D. Peningkatan Kemampuan Menulis Teks Laporan Hasil Observasi Dengan Menggunakan Pendekatan Discovery Di Kelas X Sma Xix Kartika 1 Bandung. Semantik. 2020;9(2):157–62.

Juliyanto F, Parjito. Rekayasa Aplikasi Manajemen E-Filling Dokumen Surat Pada PT ALP (Atoism Lampung Pelayaran). J Teknol dan Sist Inf. 2021;2(1):43–9.

Surahman E, Satrio A, Sofyan H. Kajian Teori Dalam Penelitian. JKTP J Kaji Teknol Pendidik. 2020;3(1):49–58.

Mimin Ninawati, Burhendi FCA, Wulandari W. Pengembangan E-Modul Berbasis Software iSpring Suite 9. J Educ FKIP UNMA. 2021;7(1):47–54.

Downloads

Published

04-08-2026

How to Cite

Cahyani, N. ., & Irsyada, R. . (2026). Application of the K-Nearest Neighbor Algorithm for Rainfall Prediction Based on Weather Conditions. Journal of Innovative and Creativity, 6(2), 44056–44066. https://doi.org/10.31004/joecy.v6i2.13702

Issue

Section

Articles