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
Get step-by-step solutions from verified subject matter experts
