1,XGBoost是Gradient Boosting算法的一种高级实现,比sklearn的效率要高
2,如果python是3.5的,可以直接下载whl,安装很方便http://www.lfd.uci.edu/~gohlke/pythonlibs/#xgboost
3,python是2.7的话就需要自己下载编译了,也可以找别人编译好的包,可以省去这一步,https://drive.google.com/file/d/0B6HXvVF1p1HWcTdwZ2dGYkVyZG8/view
4,下载完后只需要将文件解压到python path\Lib\site-packages

5,在python-package目录下执行安装命令 python setup.py install
6,验证安装 import xgboost结果报错:WindowsError: [Error 126]

是因为没有安装mingw-64
7安装mingw-64

再把安装路径C:\Program Files\mingw-w64\x86_64-7.1.0-posix-seh-rt_v5-rev0\bin配置到环境变量,要放在path的前面,不然可能会报WindowsError: [Error 127]的错误,因为其中有dll在别的路径中存在
网友评论