This paper presents a prediction and compensation approach for thermal errors of 5-axis machine tools, based on supervised online machine learning. Process-intermittent probing is used to identify and update a thermal autoregressive with exogenous input (ARX) model. The approach is capable of predicting and compensating thermal displacements of the tool center point based on changes in the environmental temperature, load-dependent changes and boundary condition changes and states, like dry or wet machining. The self-optimized machine tool shows very stable long-term behavior under drastically varying machining and boundary conditions. The implementation is validated on a set of thermal test pieces. The test pieces show that the major share of thermal workpiece errors are reduced by the thermal adaptive learning control.