Implementasi Naïve Bayes dan Decision Tree Untuk Klasifikasi Jenis Tanaman
Abstrak
AbstrakSektor pertanian berkontribusi penting bagi perekonomian Indonesia, namun pemilihan tanaman masih mengandalkan cara tradisional yang kurang efisien. Penelitian ini mengembangkan sistem klasifikasi tanaman berbasis parameter tanah dan iklim dengan algoritma Naïve Bayes serta Decision Tree. Proses penelitian mengikuti enam tahap CRISP-DM. Data diambil dari Kaggle dengan variabel nitrogen, fosfor, kalium, suhu, kelembapan, pH, dan curah hujan. Evaluasi memakai Confusion Matrix dan Cross-Validation dengan akurasi, presisi, recall, dan F1-score. Hasilnya, Decision Tree akurat pada data latih (97,95%) namun turun di data uji (91,57%), sedangkan Naïve Bayes lebih stabil (95,25%–95,32%) sehingga direkomendasikan karena hasil yang konsisten dan lebih dapat diandalkan. Perbedaan ini terjadi karena kompleksitas struktur Decision Tree membuatnya lebih rentan terhadap overfitting, sedangkan Naïve Bayes yang bersifat probabilistik lebih stabil terhadap variasi data.
Kata kunci: Pertanian, Klasifikasi Tanaman, Naïve Bayes, Decision Tree, CRISP-DM
AbstractThe agricultural sector plays an important role in Indonesia’s economy, yet crop selection still relies on traditional practices that are often inefficient. This study develops a crop classification system based on soil and climate parameters using the Naïve Bayes and Decision Tree algorithms. The research process follows the six stages of CRISP-DM. The dataset, obtained from Kaggle, includes nitrogen, phosphorus, potassium, temperature, humidity, soil pH, and rainfall. Evaluation was conducted with a Confusion Matrix and Cross-Validation using accuracy, precision, recall, and F1-score. Results indicate that Decision Tree achieved 97.95% accuracy on training data but decreased to 91.57% on testing data, while Naïve Bayes remained more stable (95.25%–95.32%), thus recommended for its consistent and more reliable performance. This difference occurs because the complexity of the Decision Tree structure makes it more prone to overfitting, while the probabilistic Naïve Bayes is more stable against data variations.
Keywords: Agriculture, Crop Classification, Naïve Bayes, Decision Tree, CRISP-DM.















