在windows 10环境下安装xgboost
来源:互联网 发布:windows xp sp3激活码 编辑:程序博客网 时间:2024/06/05 19:46
1、 安装MinGW64
MinGW64官网下载不稳定,总是失败。我采用其编译器集成包TDM-GCC-64。
TDM-GCC-64下载地址:http://tdm-gcc.tdragon.net/。
我选择的是:tdm64-gcc-5.1.0-2.exe,如果下载过慢,可以选择切换镜像:如东京。
下载完后,再安装即可。
复制一份\TDMGCC\bin\mingw32-make.exe ,将其名字更改为make.exe,置于同目录下。
或者,可以用其它集成环境,参考:https://www.zhihu.com/question/26201557
2、 安装Git
官网下载也是很慢,采用离线下载方式,下载git再安装。
下载地址:http://download.csdn.net/detail/u010035907/9815705
3、安装xgboost。
(1)下载xgboost并编译
首先,打开Git Shell,依次执行如下命令:
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
git checkout 9a48a40
git submodule init
git submodule update
cp make/mingw64.mk config.mk
cp make/mingw64.mk dmlc-core/config.mk
cd rabit
make lib/librabit_empty.a -j4
cd ../dmlc-core
make -j4
cd ..
make -j4
注:若有警告,可以忽略。
(2)安装到python包 \xgboost\python-package
cd python-package
python setup.py install
(3)导入xgboost包
import xgboost as xgb
help(xgb)
(4)使用clone下来的文件xgboost\demo进行程序测试
cd ..
cd demo
cd guide-python
python basic_walkthrough.py
结果如下:
C:\Users\hhxsym\Desktop\xgb\xgboost\demo\guide-python>pythonbasic_walkthrough.py
D:\usr\Anaconda2\lib\site-packages\sklearn\cross_validation.py:44:DeprecationWarning: This module was deprecated in version 0.18 in favor of themodel_selection module into which all the refactored classes and functions aremoved. Also note that the interface of the new CV iterators are different fromthat of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
[14:19:55] 6513x127 matrix with 143286entries loaded from ../data/agaricus.txt.train
[14:19:55] 1611x127 matrix with 35442entries loaded from ../data/agaricus.txt.test
[0] eval-error:0.042831 train-error:0.046522
[1] eval-error:0.021726 train-error:0.022263
error=0.021726
[14:19:55] 1611x127 matrix with 35442entries loaded from dtest.buffer
start running example of build DMatrix fromscipy.sparse CSR Matrix
[0] eval-error:0.042831 train-error:0.046522
[1] eval-error:0.021726 train-error:0.022263
start running example of build DMatrix fromscipy.sparse CSC Matrix
[0] eval-error:0.042831 train-error:0.046522
[1] eval-error:0.021726 train-error:0.022263
start running example of build DMatrix fromnumpy array
[0] eval-error:0.042831 train-error:0.046522
[1] eval-error:0.021726 train-error:0.022263
至此,xgboost安装及验证完毕。
参考资料:
1、https://www.zhihu.com/question/26201557
2、http://blog.csdn.net/bon_mot/article/details/51742869#0-tsina-1-68989-397232819ff9a47a7b7e80a40613cfe1
- 在windows 10环境下安装xgboost
- xgboost 在windows的环境的安装
- 如何在python环境下安装xgboost
- xgboost 在window7环境下安装
- xgboost在windows下的安装
- xgboost python 在windows下安装
- 在windows下安装xgboost简易教程
- xgboost在Windows下的安装
- Windows 下安装 XGBoost
- Windows下安装XGBoost
- Windows下安装xgboost
- windows下安装xgboost
- windows下安装xgboost
- windows下xgboost安装
- 如何在Windows 10中安装XGBoost
- windows环境下安装和配置xgboost教程
- windows 10 安装xgboost
- xgboost在windows下的安装与使用
- Android listview显示复杂页面(inflate打气筒,将布局转换成view)
- HTML
- Qt实现简单图形绘制,双缓冲机制和显示SVG格式图片
- 提高篇—统计字符串总共出现多少次数字?
- 【C++学习笔记】for与while
- 在windows 10环境下安装xgboost
- HDFS副本放置节点选择的优化
- bzoj 1935 && bzoj 4322 离线+树状数组
- Docker 镜像篇
- php存储过程调用实例代码
- YJKJdoTjs
- 最长回文子串——Manacher算法
- Web 服务架构类型
- 大话设计模式读书笔记(十) 建造者模式