mars.learn.utils.multiclass.
is_multilabel
Check if y is in a multilabel format.
y
y (numpy array of shape [n_samples]) – Target values.
out – Return True, if y is in a multilabel format, else `False.
True
`False
bool,
实际案例
>>> import mars.tensor as mt >>> from mars.learn.utils.multiclass import is_multilabel >>> is_multilabel([0, 1, 0, 1]).execute() False >>> is_multilabel([[1], [0, 2], []]).execute() False >>> is_multilabel(mt.array([[1, 0], [0, 0]])).execute() True >>> is_multilabel(mt.array([[1], [0], [0]])).execute() False >>> is_multilabel(mt.array([[1, 0, 0]])).execute() True