Abstract
This study investigates tree-based machine learning models for global multi-crop yield prediction using historical and real time climate data from Kaggle and the national aeronautics and space administration (NASA) and application programming interface (API).To improve the quality of the dataset several preprocessing steps were carried out.Random Forest, Decision Tree, Linear Regression, XGBoost, and LightGBM were trained and tested, with these models, with random forest achieving the highest accuracy R 2 = 0.9830, mean absolute error (MAE) = 0.0668 and root mean squared error (RMSE) = 0.1437.The trained models were also examined under drought and flood conditions to study their behaviour when climatic conditions varied significantly.A Flask-based web application was developed to deliver real-time yield predictions in a user-friendly format.Correlation analysis highlighted temperature, rainfall, and pesticide use as key yield factors.The results show that tree-based models, particularly random forest, provide a strong balance between accuracy and interpretability, making them suitable for smart agriculture applications.