我正在对一个巨大的数据集及其显示进行 XGBoost 分类:
Tree method is automatically selected to be 'approx' for faster speed. to use old behavior(exact greedy algorithm on single machine), set tree_method to 'exact'
我怎样才能把它改成准确的?
我试过clf = xgb(tree_method='exact')了,它返回错误!
我正在对一个巨大的数据集及其显示进行 XGBoost 分类:
Tree method is automatically selected to be 'approx' for faster speed. to use old behavior(exact greedy algorithm on single machine), set tree_method to 'exact'
我怎样才能把它改成准确的?
我试过clf = xgb(tree_method='exact')了,它返回错误!
Indeedtree_method是 Tree Booster 的一个参数。有 4 个选项,即auto、和。默认设置为根据数据集的大小启发式地选择更快的算法。由于您的数据集很大,因此在您的情况下选择了近似算法 ( )。exactapproxhistautoapprox
要更改树构造算法,您必须传入函数,如下所示tree_method:train
import xgboost as xgb
...
parameters = {'tree_method': 'exact'} #You can add other parameters as well
model = xgb.train(parameters, x_train, num_round) #num_round is the number of rounds for boosting
prediction = model.predict(x_test)
...
我希望这有帮助。