Spontaneous coal combustion (SCC) in longwall gobs is a serious disaster and requires prediction tools to accurately and reliably predict the temperature in gobs, but currently, there has been a lack of simple and efficient predictors. To address this issue, the temperature distributions in a longwall gob under different mining state parameters were simulated using a multi-fields coupled model. The temperature distribution and the mining state parameters were extracted to serve as input variables for prediction. Two machine learning models, integrating parameter optimization and ensemble learning strategies, respectively, were proposed to establish the functional relationships between the dynamic change boundary temperature and the maximum temperature in the gob. The results show that these two models have good prediction accuracy on the high-temperature points in longwall gobs, indicating that the ensemble learning has improved prediction accuracy. There is a positive correlation between the number of measuring points and the prediction accuracy, and three measurement points at the key locations can deliver reliable predictive performance.