Journal of Innovative and Creativity
Vol. 6 No. 2 (2026)

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

Nita Cahyani (Universitas Padjadjaran)
Rahmat Irsyada (Politeknik Negeri Subang)



Article Info

Publish Date
04 Aug 2026

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.

Copyrights © 2026






Journal Info

Abbrev

joecy

Publisher

Subject

Education Languange, Linguistic, Communication & Media Mathematics Social Sciences Other

Description

Journal of Innovative and Creatifity (JOECY) publishes research articles in the field of education which report empirical research on topics that are significant across educational contexts, in terms of design and findings. The topic could be in curriculum, teaching learning, evaluation, quality ...