MCPcopy Create free account
hub / github.com/dmlc/xgboost / run_split_value_histograms

Function run_split_value_histograms

python-package/xgboost/testing/parse_tree.py:25–32  ·  view source on GitHub ↗

Tests split_value_histograms with categorical features.

(tree_method: str, device: Device)

Source from the content-addressed store, hash-verified

23
24
25def 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)

Callers 2

Calls 5

XGBRegressorClass · 0.85
make_categoricalFunction · 0.70
fitMethod · 0.45
get_boosterMethod · 0.45

Tested by 2