Tests split_value_histograms with categorical features.
(tree_method: str, device: Device)
| 23 | |
| 24 | |
| 25 | def run_split_value_histograms(tree_method: str, device: Device) -> None: |
| 26 | """Tests split_value_histograms with categorical features.""" |
| 27 | X, y = make_categorical(1000, 10, 13, onehot=False) |
| 28 | reg = XGBRegressor(tree_method=tree_method, enable_categorical=True, device=device) |
| 29 | reg.fit(X, y) |
| 30 | |
| 31 | with pytest.raises(ValueError, match="doesn't"): |
| 32 | reg.get_booster().get_split_value_histogram("3", bins=5) |