Question: Write a function that takes a confusion matrix as input and returns index of the class with the maximum f1 score. def max_f1_score(cm): Inputs:

Write a function that takes a confusion matrix as input and returns index of the class with the maximum f1 score.

def max_f1_score(cm):

"""

Inputs:

cm : confusion matrix, 2-d numpy array

Outputs:

integer, index of class with max f1 score

"""

### Write your code here

Step by Step Solution

3.49 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Python code import numpy function to find the max score def maxf1scorecm finding number of rows and ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!