The thermal error caused during the high-speed operation of a high-speed motorized spindle has a significant impact on machine tool precision. In this paper, we firstly built, constructed an experimental platform for variable voltage preloaded motorized spindle, used the natural deceleration experimental method to ascertain the spindle's thermal displacement and temperature information when bearing preload is 1400 N, 1450 N, 1550 N and 1700 N, and combined with the thermoelasticity theoretical analysis, the thermal displacement of affected by the heat generation of motor and bearing was separated, and a new artificial bee colony algorithm-optimized BP neural network-based thermal error prediction model has been presented. The thermal displacements of the spindles are separated and a BP neural network optimization of a novel thermal error prediction model based on Improved Artificial Bee Colony Algorithm (IABC-BP) is proposed for transformer preloaded spindles. Combined with the experimental data of bearing preload of 1400 N, the thermal displacements of the spindle at preloads of 1450 N, 1550 N and 1700 N are predicted, and the evaluation indexes obtained from the simulation of the BP, ABC-BP, and IABC-BP models are compared. absolute error (MAE) and root-mean-square error (RMSE), higher goodness-of-fit (R2), and 20.37 % lower mean absolute error and 26.83 % lower root-mean-square error compared with the traditional thermal error prediction model. The IABC-BP prediction model proposed in this paper provides a more accurate compensation method for transformer preloaded spindles.