Predicted labels, as returned by a classifier. Sparse matrix is only
supported when labels are of multilabel type.
normalize : bool, default=True
If False, return the number of misclassifications.
Otherwise, return the fraction of misclassifications.
sample_weight : array-like of shape (n_samples,), default=None
Sample weights.
Returns:
loss : float
If normalize==True, returns the fraction of misclassifications, else
returns the number of misclassifications.
Notes
In multilabel classification, the zero_one_loss function corresponds to
the subset zero-one loss: for each sample, the entire set of labels must be
correctly predicted, otherwise the loss for that sample is equal to one.