xgboost入门以及windows下安装及使用一

来源:互联网 发布:淘宝自行车用品店推荐 编辑:程序博客网 时间:2024/06/03 17:25

下载:http://download.csdn.NET/detail/zhuqiuhui/9476012 


以下转自:http://blog.csdn.net/zhuqiuhui/article/details/50450732

本文只是简介一下如何在windows下Python下安装及运行

(1)首先配置好python环境,这个不多说了。

(2)下载xgboost代码(截止到2016年3月29号,新版本的xgboost代码还不支持windows,以下讲解的是旧版本的xgboost,如果有人想要旧版本的,我已经上传到我的资源上了,网址如下:http://download.csdn.NET/detail/zhuqiuhui/9476012 可自行下载!)

https://github.com/dmlc/xgboost(官方网站但最新的不支持windows)

(3)解压后,用Visual Studio(2010及其以上版本)来进行编译。打开Visual Studio后,open->E:\xgboost-master\xgboost-master\windows\xgboost.sln即可,全部编译一下,选择win32和release(64位的可以选择64),rebuild all resolution,出现3个都编译成功即可。

把 编译生成的xgboost_wrapper.dll, xgboost_wrapper.lib和xgboost.exe拷贝到\xgboost-master\python-package\xgboost中

(4)安装xgboost的python库。在cmd中把当前目录改到xgboost根文件加下面的python-package 文件夹,然后运行python setup.py install,即可完成xgboost的安装。会出现:

Installed c:\python27\lib\site-packages\xgboost-0.4-py2.7.egg
Processing dependencies for xgboost==0.4
Searching for scipy==0.16.1
Best match: scipy 0.16.1
Adding scipy 0.16.1 to easy-install.pth file

Using c:\python27\lib\site-packages
Searching for numpy==1.7.0
Best match: numpy 1.7.0
Adding numpy 1.7.0 to easy-install.pth file

Using c:\python27\lib\site-packages
Finished processing dependencies for xgboost==0.4(只取了成功后下面的一小部分)

注意:使用xgboost时候直接使用import xgboost as xgb python中使用xgboost时候,需要指明wrapper文件夹的所在,譬如使用如下的命令sys.path.append(‘C:\\.........\\xgboost\\wrapper‘) 。xgboost就已经安装完成了,应该可以正常使用了


0 0
原创粉丝点击