is_multilabel#

sklearn.utils.multiclass.is_multilabel(y)[source]#

Check ify is in a multilabel format.

Parameters:
yndarray of shape (n_samples,)

Target values.

Returns:
outbool

ReturnTrue, ify is in a multilabel format, elseFalse.

Examples

>>>importnumpyasnp>>>fromsklearn.utils.multiclassimportis_multilabel>>>is_multilabel([0,1,0,1])False>>>is_multilabel([[1],[0,2],[]])False>>>is_multilabel(np.array([[1,0],[0,0]]))True>>>is_multilabel(np.array([[1],[0],[0]]))False>>>is_multilabel(np.array([[1,0,0]]))True
On this page

This Page