简单到一步安装 xgboost (Windows 64位环境)——anaconda环境

1、下载window匹配的xgboost程序(我的是64位系统,3.7版本的python)

下载网址 https://www.lfd.uci.edu/~gohlke/pythonlibs/#xgboost 

 

 2、搜索anaconda Prompt ,打开命令行。

 

3、切换目录到下载了xgboost文件的目录,然后输入pip install 文件名,回车。

 

4、在python中输入如下code,执行成功。xgboost安装完成。

import xgboost as xgb
import numpy as np

data = np.random.rand(5,10) # 5 entities, each contains 10 features
label = np.random.randint(2, size=5) # binary target
dtrain = xgb.DMatrix( data, label=label)

 

posted @ 2019-05-17 19:04  xitingxie  阅读(472)  评论(0编辑  收藏  举报