The development of precise, efficient, and cost-effective temperature prediction algorithms to maintain the ambient charging and operational environment of electric vehicles (EVs) has gained significance in recent times. Machine learning algorithms are widely used for prediction and decision-making processes due to the growing presence of optimized statistical models based on training datasets, that are far superior to conventional computational statistical methods. In this work, a temperature dataset has been generated in real-time from an IoT and temperature sensor-based hardware, clipped-on the casing of a vehicle, pre-possessed and fitted into optimized models so that future values of temperature can be accurately predicted using different supervised regression machine learning algorithms. The predicted temperatures have been compared with the actual recorded temperatures and a statistical error analysis has been done to compare the results based on the Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), R-Square (R-2) and adjusted R-2 Score. The advantage of this methodology is that it is independent of system parameters, and that any future values of critically high temperature may be predicted before they occur, so that drivers can be alerted and take corrective measures before actual damage takes place. This methodology may be applied to prevent incidents of fire in EV batteries, energy wastage due to high temperatures during charging or normal running, and to enhance passenger comfort.