Optimizing Crop Selection Using Machine Learning for Sustainable Agriculture in Egypt

Document Type : Original Article

Author

High Institute for Computers and Information Technology AL-Shorouk Academy

10.21608/asc.2025.431307

Abstract

Agriculture plays a vital role in Egypt’s economy, yet crop selection remains challenging due to environmental variability, soil degradation, and water scarcity. This study introduces a data-driven crop recommendation model using the Random Forest algorithm, trained on environmental parameters including nitrogen (N), phosphorus (P), potassium (K), soil pH, temperature, humidity, and rainfall. The dataset was compiled from the FAO, Kaggle, and the Egyptian Agricultural Research Center.
The model was compared against Support Vector Machine (SVM), Decision Tree (DT), and Linear Regression (LR) using accuracy, precision, recall, and F1-score as performance metrics. The Proposed Model (RF) achieved the highest results, including 100% accuracy and an F1-score of 1.00, demonstrating robust generalization and suitability for real-world deployment. These findings highlight the potential of machine learning in supporting sustainable agricultural planning under Egypt’s unique environmental conditions.

Keywords