Search for question
Question

[19] Code Markdown Run All ExClear All Outputs Outline Question (5 pts) Report out basic confusion matrix metrics with sklearn.metrics's classification_report precision recall f1-score support/n目 Quiz 07 Question (5 pts) Find the errors and fix them. This code should create a randomly generated confusion matrix. It uses a diagonal matrix with added noise. It also has a function to convert the confusion matrix into vectors of actual and predicted variables. # Given Data (confusion matrix) import numpy as np. np.random.seed(501) cm = * np.diag(np.ones(5)) 20 cm CM + (np.random.random((5, 10)) 0.2) * 10 cm np.abs (np.floor(cz)).astype (np. uint) print(cm) def confusion_to_arrays (classes table): values ■ [) for index in Indenumerate(table).

Fig: 1

Fig: 2