Published: 2025-10-01
Klasifikasi Kualitas Tanah Berdasarkan Kandungan pH, Kelembapan, dan Suhu Menggunakan Algoritma K-Nearest Neighbors
DOI: 10.35870/jtik.v9i4.4049
Md Wira Putra Dananjaya, Gede Humaswara Prathama, I Gusti Ngurah Darma Paramartha, Putu Gita Pujayanti
- Md Wira Putra Dananjaya: Universitas Pendidikan Nasional
- Gede Humaswara Prathama: Universitas Pendidikan Nasional
- I Gusti Ngurah Darma Paramartha: Universitas Pendidikan Nasional
- Putu Gita Pujayanti: Universitas Pendidikan Nasional
Abstract
This study aims to analyze soil quality using the K-Nearest Neighbors (KNN) algorithm based on environmental parameters such as temperature, humidity, pH, and nutrient content (N, P, K). The dataset used consists of 660 entries covering 22 different classes describing soil types with varying characteristics. The KNN model was applied to classify soil quality, and the results were evaluated using the Confusion Matrix and Classification Report. The accuracy of the model obtained was around 61%, indicating potential improvements in the classification of some more difficult soil classes. The model performed better on certain classes such as kidney beans, chickpeas, and grapes, but was less than optimal on other classes such as watermelon and pomegranate. These results indicate class alignment in the dataset that affects model performance. This study contributes to the application of machine learning algorithms in agriculture, especially for soil quality monitoring. In the future, this study opens up opportunities for further improvements by using parameter optimization techniques and other more complex algorithms. Thus, the results of this study can be used as a basis for developing intelligent systems for more effective and efficient soil management.
