 This paper proposes a novel approach to temperature forecasting using recurrent neural networks, RNN. Five different model configurations were developed for five different cities in China. The rich regularizer was used to control the training process and prevent overfitting and underfitting. Finally, the Bayesian optimization method was used to optimize the hyperparameters including network nodes, regularization parameters, and batch size. The experimental results showed that the LSTM RNN model achieved the lowest error rate compared to other models. Furthermore, the feature selection method was applied to the established models, resulting in simpler models with higher prediction accuracy. This study demonstrates the effectiveness of RNN in temperature forecasting and provides a new perspective for future research. This article was authored by Edward Apankidia, Li Chunlong, Jing Inchuan, and others.