Crop Recommendation Analysis and Validation in Nigeria Using Machine Learning Algorithms
Keywords:
Climate data, Soil nutrients, Machine learning, Crop selection predictive model, Agricultural productivityAbstract
Crop recommendation systems are crucial for optimizing agriculture by suggesting crops based on environmental and soil conditions. Failure in selecting suitable crops can result in low yields and resource wastage. This study builds an improved recommendation system for Nigerian farmers. Data from various sources, including the Nigeria Metrological Agency, the Agronomy Department University of Ibadan, Ahmadu Bello University Zaria, and Federal University Wukari, were preprocessed using numpy and pandas. The climate parameters used were Rainfall, Temperature and Humidity while the soil parameters were Nitrogen (N), Phosphorus (P), Potassium (K), Calcium (C) and Magnesium (Mg). The pH was used to measure the soil acidity or alkalinity. The 18 crops considered were Bambara Nut, Cassava, Cocoyam, Tomato, Yam, Acha, Cocoa, Beans, Groundnut, Beniseed, Maiza, Rice, Oil Palm, Cashew, Sugar cane, Sweet Potato, Pepper and Coconut. After preprocessing, the dataset was partitioned into training, validation, and testing sets in the ratio 80:10:10. Four Machine learning algorithms which are Random Forest, Naïve Bayes, K Nearest Neighbor, and Support Vector Machine (SVM) were employed, with Random Forest outperforming others in accuracy, precision, recall, and F1 score. Naïve Bayes ranked second, followed by K Nearest Neighbor, and Support Vector Machine performed as the poorest. The models effectively recommended crops for specific climates and soils, with SVM being the least effective. Hence, this study demonstrates the importance of accurate crop recommendations in maximizing agricultural productivity