在Windows上安装Xgboost(Python)

2017-06-01  本文已影响0人  Fruit_初

摘自: 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看是否配置成功

上一篇 下一篇

猜你喜欢

热点阅读