Rise in temperature and its unpredictability has an adverse effect on growth and yield, making it an important variable in tomato (Solanum lycopersicum L.) production. This study aimed at evaluating the impact of temperature variability on tomato yield and developing predictive models using Machine Learning (ML) techniques to forecast future productivity under changing climate. The tomato yield was predicted using Machine Learning Models (MLM) such as Random Forest (RF), XGBoost (XG) and K-Nearest Neighbours (KNN) in response to temperature changes. The model was evaluated and improved by comparing both Train-Test split (T-T) and K-fold cross validation techniques. Among these, the T-T method performed better and was used for model training and testing. The findings showed that RF model outperformed the others, with the T-T dataset, achieving Coefficient of Determination (R2) = 0.84, Mean Squared Error (MSE) = 7.88, Root Mean Square Error (RMSE) = 2.81 and Mean Absolute Error (MAE) = 1.19, followed by XGBoost and KNN. Additionally, Kernel Density Estimation (KDE) correlation analysis was employed to examine the relationship between yield and temperature. Moreover, future tomato yields were predicted under Shared Socio-economic Pathways (SSP2-4.5 and SSP5-8.5) for the period of 2023-2026 using the RF model. Tomato productivity is likely to increase gradually in the immediate future and eventually fall under extreme heat. These findings illustrate the potential of machine learning in forecasting tomato yield under varying temperature conditions, thereby aiding climate adaptation strategies and agricultural planning.