如何在Python上安装xgboost

2025-04-27 19:21:23
推荐回答(1个)
回答1:

对于Linux平台运行pip(3) install xgboost即可。对 windows平台,官方建议自行编译:步骤1、clone Github项目
2、git checkout 9bc3d16(此分支中包含windows所需文件)
3、用visual studio2013打开位于xgboost/windows的项目
4、VS2013中打开configuration manager
选择active solution configuration中release
选择active solution platform中x64
5、重构(rebuild)xgboost和xgboost_wapper
6、拷贝xgboost/windows/x64/release文件夹里所有文件到到xgboost/wrapper
7、去xgboost/python-package运行python setup.py install
8、检查是否完成安装:python -c "import xgboost"