在Windows上安装Xgboost(Python)

摘自: https://stackoverflow.com/questions/33749735/how-to-install-xgboost-package-in-python-windows-platform

Step 1
安装cmake工具,https://cmake.org/download/
可以在命令行输入cmake查看安装版本确保安装成功

$ cmake
Usage

cmake [options] <path-to-source>
cmake [options] <path-to-existing-build>
...

Step 2
复制Xgboost的代码,https://github.com/dmlc/xgboost xgboost_dir
①安装了git的可以直接在命令行输入
$ git clone https://github.com/dmlc/xgboost xgboost_dir
②没有安装git的可以自行在github网页上下载,然后解压到xgboost_dir中

Step 3

Step 4
在xgboost目录下执行:

git submodule init
git submodule update
cp make/mingw64.mk config.mk
mingw32-make.exe -j4

注意,要重启一下cmd,不然环境变量的设置对当前开着的cmd无效的

Step 5
打开xgboost_dir中的python-package安装

cd xgboost_dir
cd python-package
python setup.py install

Step 6
在python中使用import xgboost看是否配置成功

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容