function confusion_matrix
Description
Constructs a confusion matrix from a sequence of probabilities or predictions.Args
probs: A sequence of predicted probabilities for each class. The sequence shape should be (N, K) where N is the number of samples and K is the number of classes. If provided,predsshould not be provided.y_true: A sequence of true labels.preds: A sequence of predicted class labels. If provided,probsshould not be provided.class_names: Sequence of class names. If not provided, class names will be defined as “Class_1”, “Class_2”, etc.title: Title of the confusion matrix chart.split_table: Whether the table should be split into a separate section in the W&B UI. IfTrue, the table will be displayed in a section named “Custom Chart Tables”. Default isFalse.
Returns
CustomChart: A custom chart object that can be logged to W&B. To log the chart, pass it to wandb.log().
Raises
ValueError: If bothprobsandpredsare provided or if the number of predictions and true labels are not equal. If the number of unique predicted classes exceeds the number of class names or if the number of unique true labels exceeds the number of class names.wandb.Error: If numpy is not installed.