Thermal errors have the largest contribution, as much as about 70%, to the machining inaccuracy of computer-numerical-controlled (CNC) machining centers. The error compensation method so far plays the most popular and effective way to minimize the thermal error. How to accurately and quickly build an applicable thermal error model (TEM) is the kernel work of thermal error compensation. On the basis of some comprehensive machine-learning schemes, past proposed TEMs had impressive merits for dealing with the thermal error modeling of single-function (milling or turning cutting) machine tools with only considering one set of thermal key points. These proposed modelling methodologies become worse when applied to CNC compound milling-turning machining centers in actual cutting applications. This paper proposes a two-mode integral TEM based on the Lasso and the random forest regression schemes to quickly and accurately predict the thermal deformations of such a machine. The first mode is the thermal error modeling for milling cutting conditions, and the second mode is that for turning cutting conditions. For data reduction, two different sets of temperature key points, one for milling and the other for turning, are obtained. Then, on the basis of the random forest regression scheme, we separately establish two TEMs but concurrently use them to predict the tool-center-point deformations of both milling as well as turning spindles. Further, we compare our proposed TEM with several frequently-used machine-learning-based TEMs and the results show that our proposed TEM are the best among all, no matter in the modelling experiment or in the test experiment. The proposed TEM has a maximum prediction error of 6.08 m for milling cutting and that of 1.455 m for turning cutting in the modeling experiment. By our proposed twomode integral TEM, the thermal error of a multi-function milling-turning machining center can be accurately predicted and quickly compensated.INDEX TERMS Thermal error model, thermal error compensation, CNC milling-turning machine tools, Lasso regression, machining learning.