Validate output for predict leaf tests.
(leaf: np.ndarray, num_parallel_tree: int)
| 14 | |
| 15 | |
| 16 | def 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 | |
| 27 | def validate_data_initialization( |
no outgoing calls