[breaking] Remove the predictor param, allow fallback to prediction using DMatrix. (#9129)
- A `DeviceOrd` struct is implemented to indicate the device. It will eventually replace the `gpu_id` parameter. - The `predictor` parameter is removed. - Fallback to `DMatrix` when `inplace_predict` is not available. - The heuristic for choosing a predictor is only used during training.
This commit is contained in:
@@ -1418,23 +1418,6 @@ def test_categorical():
|
||||
np.testing.assert_allclose(predt_cat, predt_enc)
|
||||
|
||||
|
||||
def test_prediction_config():
|
||||
reg = xgb.XGBRegressor()
|
||||
assert reg._can_use_inplace_predict() is True
|
||||
|
||||
reg.set_params(predictor="cpu_predictor")
|
||||
assert reg._can_use_inplace_predict() is False
|
||||
|
||||
reg.set_params(predictor="auto")
|
||||
assert reg._can_use_inplace_predict() is True
|
||||
|
||||
reg.set_params(predictor=None)
|
||||
assert reg._can_use_inplace_predict() is True
|
||||
|
||||
reg.set_params(booster="gblinear")
|
||||
assert reg._can_use_inplace_predict() is False
|
||||
|
||||
|
||||
def test_evaluation_metric():
|
||||
from sklearn.datasets import load_diabetes, load_digits
|
||||
from sklearn.metrics import mean_absolute_error
|
||||
|
||||
Reference in New Issue
Block a user