jaccard_similarity_score(y_true, y_pred, normalize=True, sample_weight=None)¶
Jaccard similarity coefficient score
Deprecated since version 0.21: This is deprecated to be removed in 0.23, since its handling of binary and multiclass inputs was broken.
jaccard_scorehas an API that is consistent with precision_score, f_score, etc.
Read more in the User Guide.
- y_true1d array-like, or label indicator array / sparse matrix
Ground truth (correct) labels.
- y_pred1d array-like, or label indicator array / sparse matrix
Predicted labels, as returned by a classifier.
- normalizebool, optional (default=True)
False, return the sum of the Jaccard similarity coefficient over the sample set. Otherwise, return the average of Jaccard similarity coefficient.
- sample_weightarray-like of shape = [n_samples], optional
normalize == True, return the average Jaccard similarity coefficient, else it returns the sum of the Jaccard similarity coefficient over the sample set.
The best performance is 1 with
normalize == Trueand the number of samples with
normalize == False.
In binary and multiclass classification, this function is equivalent to the
accuracy_score. It differs in the multilabel classification problem.