Agriculture drives Somalia’s economy, but challenges like unpredictable weather, limited resources, and poor infrastructure hamper productivity and economic progress. Emerging technologies like machine learning and IoT offer transformative solutions, optimizing crop yield and resource use. This research demonstrates the substantial impact of integrating Machine Learning (ML) and Internet of Things (IoT) technologies to improve agricultural decisions in Somalia. The study conducts a comprehensive comparison of Decision Trees (DT), K-nearest Neighbor (KNN), and Random Forest algorithms within a Crop Recommendation System. The Decision Tree algorithm emerges as the standout performer, boasting an impressive accuracy of 99.2% and achieving well-balanced precision, recall, and F1-score metrics. Its transparency and interpretability render it an optimal choice for guiding agricultural choices. Despite …