xgboost安装

本文介绍了在Windows上安装XGBoost的详细步骤,包括配置Python环境,下载并编译旧版XGBoost源码,使用Visual Studio进行编译,以及安装Python库。由于新版本不支持Windows,提供了一个旧版本的下载链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

据说很好用,but貌似目前版本都不大支持window

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

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

https://github.com/dmlc/xgboost

(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(只取了成功后下面的一小部分) 
然后impor xgboost未出现错误则说明成功
注意:在编译的时候根据你自己Python的环境来选择win32还是x64



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值