Abstract:Proposes a SA-PSO-XGBoost prediction model for forecasting the temperature in Nanjing, based on ECMWF meteorological data from January 1, 2016, to December 31, 2017. The meteorological data is divided into training and testing sets. The PCA dimension reduction method is applied to compress and reduce the features of the meteorological data. The SA-PSO-XGBoost model optimizes the hyperparameters using a hybrid algorithm combining simulated annealing and particle swarm optimization. The testing set is then used to compare the performance of the SA-PSO-XGBoost model with XGBoost, GRU, and LSTM neural networks. Experimental results demonstrate that the SA-PSO-XGBoost model outperforms others in terms of accuracy and robustness in predicting the temperature 6 hours ahead.