def get_leaf(labels): # Obtain the leaf as the majority of the labels return np.bincount(labels).argmax()