To better solve the problem of thermal error of computerized numerical control machining equipment (CNCME), a thermal error prediction model based on the sparrow search algorithm and long short-term memory neural network (SSA-LSTMNN) is proposed. Firstly, the Fuzzy C-means clustering algorithm (FCMCA) is used to screen the key temperature-sensitive points of the CNCME. Secondly, by taking the temperature rise data of key temperature-sensitive points as input and the corresponding time thermal error data as output, we established the SSA-LSTMNN thermal error prediction model. The SSA is used to optimize the parameters of LSTMNN and make its performance play the best. Taking the VMC1060 vertical machining center as the research object, we carried out the experiment. Finally, the prediction effect of the proposed model is compared with the article swarm optimized algorithm and LSTM neural network (PSOA-LSTMNN), the LSTMNN, and the traditional recurrent neural network (TRNN) model. The results show that the average values of the predicted residual fluctuations of the SSA-LSTMNN model are all more than 44% lower than those of the other three models under different operating conditions, which has a strong practicality.