Accurate crop yield prediction is essential for addressing food security challenges, particularly in regions facing climatic variability and resource constraints. This study proposes a machine learning–based framework for rice yield prediction in Hadejia and Auyo, Jigawa State, Nigeria, by integrating soil properties, irrigation methods, water usage, fertilization practices, pest infestation data, and local weather variables. Four ensemble learning algorithms, Random Forest, Gradient Boosting, XGBoost, and LightGBM, were trained and evaluated using both a traditional 80/20 hold-out split and k-fold cross-validation to ensure robust performance assessment. Among these models, Random Forest achieved the highest predictive accuracy, recording an R² of 0.9529 and RMSE of 1.1118, demonstrating its effectiveness in capturing complex, non-linear interactions among agronomic factors. The proposed approach underscores the value of localized data, offering farmers, policymakers, and stakeholders a scalable decision-support tool for optimizing resource allocation, mitigating risks, and enhancing overall agricultural productivity. This research provides a practical roadmap for precision agriculture initiatives in Jigawa State and other regions with similar agroecological conditions by illustrating how comprehensive feature integration and ensemble-based machine learning can significantly improve yield forecasts.