通过Scikit Learn API的XGB似乎并未在GPU中运行,尽管已编译为针对GPU运行

use*_*512 5 machine-learning scikit-learn xgboost

尽管XGB已编译为可在GPU上运行,但通过Scikit Learn API调用/执行时,似乎并未在GPU上运行。

请告知这是否是预期的行为

gaw*_*w89 5

据我所知,Scikit学习API当前不支持GPU。您需要使用学习API(例如xgboost.train(...))。这还要求您首先将数据转换为xgboost DMatrix。

例:

params = {"updater":"grow_gpu"}
train = xgboost.DMatrix(x_train, label=y_train)
clf = xgboost.train(params, train, num_boost_round=10)
Run Code Online (Sandbox Code Playgroud)

更新:

现在,Scikit Learn API通过** kwargs参数支持GPU:http : //xgboost.readthedocs.io/en/latest/python/python_api.html#id1