@@ -2350,6 +2350,21 @@ def balanced_accuracy_score(y_true, y_pred, *, sample_weight=None, adjusted=Fals
23502350 return score
23512351
23522352
2353+ @validate_params (
2354+ {
2355+ "y_true" : ["array-like" , "sparse matrix" ],
2356+ "y_pred" : ["array-like" , "sparse matrix" ],
2357+ "labels" : ["array-like" , None ],
2358+ "target_names" : ["array-like" , None ],
2359+ "sample_weight" : ["array-like" , None ],
2360+ "digits" : [Interval (Integral , 0 , None , closed = "left" )],
2361+ "output_dict" : ["boolean" ],
2362+ "zero_division" : [
2363+ Options (Real , {0 , 1 }),
2364+ StrOptions ({"warn" }),
2365+ ],
2366+ }
2367+ )
23532368def classification_report (
23542369 y_true ,
23552370 y_pred ,
@@ -2376,7 +2391,7 @@ def classification_report(
23762391 labels : array-like of shape (n_labels,), default=None
23772392 Optional list of label indices to include in the report.
23782393
2379- target_names : list of str of shape (n_labels,), default=None
2394+ target_names : array-like of shape (n_labels,), default=None
23802395 Optional display names matching the labels (same order).
23812396
23822397 sample_weight : array-like of shape (n_samples,), default=None
0 commit comments