Journal of System and Computer Engineering
Vol 6 No 3 (2025): JSCE: July 2025

Crop Recommendation Based on Soil and Weather Conditions Using the K-Nearest Neighbors Algorithm

Yuliyanto, Yuliyanto (Unknown)
Sahibu, Supriadi (Unknown)
Imran, Taufik (Unknown)
Arisha, Andriansyah Oktafiandi (Unknown)
Munawirah, Munawirah (Unknown)



Article Info

Publish Date
02 Aug 2025

Abstract

The national food self-sufficiency program demands innovation in optimizing the selection of agricultural commodities based on environmental and weather conditions. This challenge is rooted in a fundamental problem faced by farmers—achieving harmony among soil characteristics, weather patterns, and suitable crops. In support of this initiative, it is necessary to develop a crop recommendation system based on machine learning that utilizes key soil and weather condition parameters. This study employs the K-Nearest Neighbors (KNN) algorithm, which functions by identifying the optimal value of ‘K’ to maximize classification accuracy. The KNN algorithm is implemented in a crop recommendation system to classify 1,100 datasets representing ideal growing conditions for 11 crop types. These datasets were generated using a normal distribution approach with a 5% variation from the mean values, and were validated using a clipping function to ensure the data remained within ideal ranges. The results of this study demonstrate that the KNN algorithm achieves high accuracy 96,67% in utilizing soil and weather parameters to generate crop recommendations. The average probability score for the recommended crops was 83.33%. Based on experimental testing, rice was recommended during the rainy and extreme rainy seasons, soybeans were recommended during the dry season, and mung beans were most suitable during extreme dry conditions.

Copyrights © 2025






Journal Info

Abbrev

JSCE

Publisher

Subject

Computer Science & IT Decision Sciences, Operations Research & Management

Description

Programming Languages Algorithms and Theory Computer Architecture and Systems Artificial Intelligence Computer Vision Machine Learning Systems Analysis Data Communications Cloud Computing Object Oriented Systems Analysis and Design Computer and Network Security Data ...