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

Function validate_leaf_output

python-package/xgboost/testing/shared.py:16–24  ·  view source on GitHub ↗

Validate output for predict leaf tests.

(leaf: np.ndarray, num_parallel_tree: int)

Source from the content-addressed store, hash-verified

14
15
16def validate_leaf_output(leaf: np.ndarray, num_parallel_tree: int) -> None:
17 """Validate output for predict leaf tests."""
18 for i in range(leaf.shape[0]): # n_samples
19 for j in range(leaf.shape[1]): # n_rounds
20 for k in range(leaf.shape[2]): # n_classes
21 tree_group = leaf[i, j, k, :]
22 assert tree_group.shape[0] == num_parallel_tree
23 # No sampling, all trees within forest are the same
24 assert np.all(tree_group == tree_group[0])
25
26
27def validate_data_initialization(

Callers 2

test_dask_predict_leafFunction · 0.90
run_predict_leafFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_dask_predict_leafFunction · 0.72