In this paper, a hybrid method of correlation analysis based on the gray theory and the least squares support vector machine is proposed to model the thermal error of spindle of NC machine tool and predict the thermal error. The gray correlation analysis is used to optimize the measuring points of spindle. The optimum measuring points and the measured thermal error of spindle are regarded as the data to be trained to build the thermal error prediction model based on the least squares support vector machine (LS-SVM). The results show that the thermal error prediction model based on LS-SVM of NC machine tool has advantages of high precision and good generalization performance. The prediction model can be used in real-time compensation of NC machine tool and can prove the process precision and reduce cost.