shap.utils.partition_tree_shuffle
- shap.utils.partition_tree_shuffle(indexes: ndarray[tuple[Any, ...], dtype[Any]], index_mask: ndarray[tuple[Any, ...], dtype[bool]], partition_tree: ndarray[tuple[Any, ...], dtype[Any]]) None
Randomly shuffle the indexes in a way that is consistent with the given partition tree.
- Parameters:
- indexes: np.array
The output location of the indexes we want shuffled. Note that len(indexes) should equal index_mask.sum().
- index_mask: np.array
A bool mask of which indexes we want to include in the shuffled list.
- partition_tree: np.array
The partition tree we should follow.