本文共 495 字,大约阅读时间需要 1 分钟。
首先从
下载xgboost-0.6-cp35-cp35m-win_amd64.whlamd64代表64位进入下载完后的地址后
pip install xgboost-0.6-cp35-cp35m-win_amd64.whl完事!官方示例代码:
import xgboost as xgb# read in datadtrain = xgb.DMatrix('agaricus.txt.train')print(dtrain)dtest = xgb.DMatrix('agaricus.txt.test')# specify parameters via mapparam = {'max_depth':2, 'eta':1, 'silent':1, 'objective':'binary:logistic' }num_round = 2bst = xgb.train(param, dtrain, num_round)# make predictionpreds = bst.predict(dtest)print(preds)
转载地址:http://tcega.baihongyu.com/