As the core component of inertial navigation systems, fiber optic gyroscope (FOG), with technical advantages such as low power consumption, long lifespan, fast startup speed, and flexible structural design, are widely used in aerospace, unmanned driving, and other fields. However, due to the temperature sensitivity of optical devices, the influence of environmental temperature causes errors in FOG, thereby greatly limiting their output accuracy. This work researches on machine-learning based temperature error compensation techniques for FOG. Specifically, it focuses on compensating for the bias errors generated in the fiber ring due to the Shupe effect. This work proposes a composite model based on k-means clustering, support vector regression, and particle swarm optimization algorithms. And it significantly reduced redundancy within the samples by adopting the interval sequence sample. Moreover, metrics such as root mean square error (RMSE), mean absolute error (MAE), bias stability, and Allan variance, are selected to evaluate the model’s performance and compensation effectiveness. This work effectively enhances the consistency between data and models across different temperature ranges and temperature gradients, improving the bias stability of the FOG from 0.022 °/h to 0.006 °/h. Compared to the existing methods utilizing a single machine learning model, the proposed method increases the bias stability of the compensated FOG from 57.11% to 71.98%, and enhances the suppression of rate ramp noise coefficient from 2.29% to 14.83%. This work improves the accuracy of FOG after compensation, providing theoretical guidance and technical references for sensors error compensation work in other fields.