Question: I have this function that calculates accuracy. I need to create another function to calculate error rate wich is just 1 - accuracy. I dont

I have this function that calculates accuracy. I need to create another function to calculate error rate wich is just 1 - accuracy. I dont know how to call another function inside the other.

def acc_score(labels, preds): c = [i for i, j in zip(labels, preds) if i == j] count = len(c) accuracy = count/ len(labels) print("Model Accuracy: ", accuracy)

I have this but I know its wrong

def error_rate(labels,preds):

error = 1 - acc_score(labels, preds) return error

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!