Klasifikasi Kualitas Tanah Berdasarkan Kandungan pH, Kelembapan, dan Suhu Menggunakan Algoritma K-Nearest Neighbors
DOI:
https://doi.org/10.35870/jtik.v9i4.4049Keywords:
KNN, Agriculture, ClassificationAbstract
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.
Downloads
References
Aljanabi, M. H., & Aljanabi, K. B. (2023). A Parallel Approach for Optimizing KNN Classification Algorithm in Big Data. Al-Salam Journal for Engineering and Technology, 2(2), 165-172.
Ayuningtias, N. H., Arifin, M., & Damayani, M. (2016). Analisa kualitas tanah pada berbagai penggunaan lahan di Sub Sub DAS Cimanuk Hulu. soilrens, 14(2). https://doi.org/10.24198/soilrens.v14i2.11035.
Budianto, I. (2023). Klasifikasi Kondisi Tanah Berdasarkan Rekomendasi Tanaman Pertanian dan Perkebunan Melalui Penggunaan Jaringan Syaraf Tiruan Klasifikasi Multinomial.
FINKA, M. G. S. (2023). Implementasi K-Nearest Neighbor (Knn) Untuk Klasifikasi Citra Serat Kayu.
Ghosh, A., Senapati, A., Das, R., Sarkar, S., Saha, J., Mahanta, A., & Pal, S. B. (2023). Crop Recommendation Assistance Using Machine Learning (KNN Algorithm) and Python GUI. American Journal of Electronics & Communication, 4(2), 7-11.
Hatuwal, B. K., Shakya, A., & Joshi, B. (2020). Plant Leaf Disease Recognition Using Random Forest, KNN, SVM and CNN. Polibits, 62, 13-19.
LISA, L. (2023). ANALISIS KANDUNGAN LOGAM DAN UNSUR HARA PADA TANAH ULTISOL DENGAN MENGGUNAKAN X-RAY FLUORESCENCE (XRF) DAN UJI LABORATORIUM (Doctoral dissertation, UNIVERSITAS JAMBI).
Putrama, Z. Implementasi metode k-medoid dalam penentuan cluster daerah berdasarkan tingkat pendapatan pajak di kabupaten pasaman barat (Bachelor's thesis, Fakultas Sains dan Teknologi UIN Syarif HIdayatullah Jakarta).
Wijayanti, E. B., Setiadi, D. R. I. M., & Setyoko, B. H. (2024). Dataset analysis and feature characteristics to predict rice production based on eXtreme gradient boosting. Journal of Computing Theories and Applications, 1(3), 299-310.
Wilson, A., Sukumar, R., & Hemalatha, N. (2021). Machine learning model for rice yield prediction using KNN regression. agriRxiv, (2021), 20210310469.
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Md Wira Putra Dananjaya, Gede Humaswara Prathama, I Gusti Ngurah Darma Paramartha, Putu Gita Pujayanti

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
1. Copyright Retention and Open Access License
Authors retain copyright of their work and grant the journal non-exclusive right of first publication under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
This license allows unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
2. Rights Granted Under CC BY 4.0
Under this license, readers are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material for any purpose, including commercial use
- No additional restrictions — the licensor cannot revoke these freedoms as long as license terms are followed
3. Attribution Requirements
All uses must include:
- Proper citation of the original work
- Link to the Creative Commons license
- Indication if changes were made to the original work
- No suggestion that the licensor endorses the user or their use
4. Additional Distribution Rights
Authors may:
- Deposit the published version in institutional repositories
- Share through academic social networks
- Include in books, monographs, or other publications
- Post on personal or institutional websites
Requirement: All additional distributions must maintain the CC BY 4.0 license and proper attribution.
5. Self-Archiving and Pre-Print Sharing
Authors are encouraged to:
- Share pre-prints and post-prints online
- Deposit in subject-specific repositories (e.g., arXiv, bioRxiv)
- Engage in scholarly communication throughout the publication process
6. Open Access Commitment
This journal provides immediate open access to all content, supporting the global exchange of knowledge without financial, legal, or technical barriers.
