Abstract:Nowadays, In view of the problem that it is difficult for traditional statistical methods to accurately and timely reveal the temporal and spatial information of economic parameters, and the accuracy of GDP estimation is insufficient. In this paper, the nighttime light images from 2012 to 2018 obtained by NPP/VIIRS are used as the data source to process the data errors and obtain the long time series data which can be used for quantitative analysis; Firstly, the random forest algorithm is used to predict the data set. On this basis, a regression error based on out of bag data estimation is proposed, and an improved grid search algorithm is used to optimize the parameters of the random forest model. At the same time, Bayesian optimization is used to optimize the parameters of random forest(RF) model. Nested 5f-cv is used to estimate the generalization ability of the model through the external 5f-cv cycle. The internal 5f-cv cycle is used to determine the optimal parameters, find out the optimal parameter model, establish the automatic prediction system, and make the algorithm model automatically and accurately predict according to the input data of the study area. The results show that the improved random forest algorithm based on Bayesian optimization is the best in GDP prediction, and the prediction accuracy reaches 97%, with high accuracy and robustness. The results show that the machine learning algorithm and nighttime illumination index can be used to predict GDP at county level.