Closed alvarag closed 6 years ago
En vez de la comprobación que haces, utilizar el método is_multilabel
http://scikit-learn.org/stable/developers/utilities.html#multiclass-and-multilabel-utility-function
>>> import numpy as np >>> from sklearn.utils.multiclass import is_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
En vez de la comprobación que haces, utilizar el método is_multilabel
http://scikit-learn.org/stable/developers/utilities.html#multiclass-and-multilabel-utility-function