The use of machine learning (ML) in agriculture has paved new avenues to improve decision making, especially in crop choice. The current research offers a data-driven crop recommendation system using a machine learning approach based on key soil and environmental factors—i.e., nitrogen (N), phosphorus (P), potassium (K), pH, temperature, humidity, and rainfall. A dataset of 2,200 soil records was processed using exploratory data analysis (EDA), normalization, and model training with algorithms such as Random Forest, Logistic Regression, and Gradient Boosting. Of these, Random Forest provided the best test accuracy of 99.32%, with high predictive ability and interpretability via feature importance measures. Violin and boxplots showed distinct feature separability among crop types, particularly in variables such as rainfall, temperature, and NPK concentrations, confirming the model's classification effectiveness. The practicability of the system is in its possible incorporation in IoT-based soil monitoring devices and cell advisory apps, delivering real-time, location-specific crop advice. This strategy enables farmers to make informed decisions, minimizes fertilizer waste, and promotes sustainable farming practices. The suggested system not only showcases technical strength but also fits well within the overall vision of smart farming and precision agriculture.
Primary Language | English |
---|---|
Subjects | Computer Software |
Journal Section | Articles |
Authors | |
Publication Date | October 8, 2025 |
Submission Date | May 1, 2025 |
Acceptance Date | June 26, 2025 |
Published in Issue | Year 2025 Volume: 9 Issue: 4 |