While lattice thermal conductivity is an important parameter for many technological applications, its calculation is a time-consuming task, especially for compounds with a complex crystal structure. In this paper, we solve this problem using machine learning interatomic potentials. These potentials trained on the density functional theory results and provide an accurate description of lattice dynamics. Additionally, active learning was applied to significantly reduce the number of expensive quantum-mechanical calculations required for training and increases reliability of the potential. The CoSb3 skutterudite was considered as an example, and the solution of the Boltzmann transport equation for phonons was compared with the Green-Kubo method. We demonstrated that accurate and reliable potentials can be obtained by performing just a few hundred quantum-mechanical calculations. The potentials reproduce not only the vibrational spectrum, but also the lattice thermal conductivity, as calculated by various methods.