XGBoost广泛用于Kaggle比赛。对于那些喜欢使用Windows的人来说,安装xgboost可能是一个艰苦的过程。因此我写了这张便条来节省你的时间。
1.构建XGBoost
公平地说,在Windows上安装XGBoost 的官方指南没有错。但是,我仍然想在这里强调几点。
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
wget https://cdn.linghao.now.sh/assets/install-xgboost/Makefile.win
cp Makefile.win Makefile
cp make/mingw64.mk config.mk
mingw32-make
注意:
- 1.Makefile.win是原版的修改版(感谢Zhou Xiyou),Makefile适合Windows上的构建过程。你可以在这里下载或下载它。
- 2.请务必使用UNIX shell,因为Windows CMD存在mkdir -p命令问题。建议使用Git Bash。
- 3.一定要使用–recursive选项git clone。
- 一定要使用合适的MinGW。建议使用TDM-GCC。请注意,默认情况下,它不会为您安装OpenMP。您需要指定它否则构建将失败。
2.安装Python绑定
这应该很简单。
cd python-package
python setup.py install
完成!请享用!
来源:章凌豪
链接:https://dnc1994.com/2016/03/installing-xgboost-on-windows/