confusion_matrix#
- cuml.metrics.confusion_matrix(
- y_true,
- y_pred,
- labels=None,
- sample_weight=None,
- normalize=None,
- convert_dtype='deprecated',
Compute confusion matrix to evaluate the accuracy of a classification.
- Parameters:
- y_truearray-like (device or host) shape = (n_samples,)
Ground truth (correct) target values.
- y_predarray-like (device or host) shape = (n_samples,)
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, default=”deprecated”
Deprecated since version 26.08:
convert_dtypewas deprecated in version 26.08 and will be removed in version 26.10. cuML only copies input arrays when necessary (e.g. to unify dtypes), there is no reason to provide this keyword going forward.
- Returns:
- Ccupy.ndarray of shape (n_classes, n_classes)
Confusion matrix on device.