confusion_matrix#
- cuml.metrics.confusion_matrix(y_true, y_pred, labels=None, sample_weight=None, normalize=None, convert_dtype=False) CumlArray[source]#
Compute confusion matrix to evaluate the accuracy of a classification.
- Parameters:
- y_truearray-like (device or host) shape = (n_samples,)
or (n_samples, n_outputs) Ground truth (correct) target values.
- y_predarray-like (device or host) shape = (n_samples,)
or (n_samples, n_outputs) Estimated target values.
- labelsarray-like (device or host) shape = (n_classes,), optional
List of labels to index the matrix. This may be used to reorder or select a subset of labels. If None is given, those that appear at least once in y_true or y_pred are used in sorted order.
- sample_weightarray-like (device or host) shape = (n_samples,), optional
Sample weights.
- normalizestring in [‘true’, ‘pred’, ‘all’] or None (default=None)
Normalizes confusion matrix over the true (rows), predicted (columns) conditions or all the population. If None, confusion matrix will not be normalized.
- convert_dtypebool, optional (default=False)
When set to True, the confusion matrix method will automatically convert the predictions, ground truth, and labels arrays to np.int32.
- Returns:
- Carray-like (device or host) shape = (n_classes, n_classes)
Confusion matrix.