Application of the K-Nearest Neighbor Algorithm for Rainfall Prediction Based on Weather Conditions - Nita Cahyani; Rahmat Irsyada (Journal of Innovative and Creativity (Joecy), 2026)
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.