I also had a similiar error,Xg boost too. But what the guy above me said, uninstall and reinstalling a lower version of sklearn (i used version 1.5.2) fixed this issue for me!
!pip uninstall -y scikit-learn !pip install scikit-learn==1.5.2