1

Efficiency of Binary Classifier

Unsolved
Fundamentals

Difficulty: 2 | Problem written by mesakarghm
Problem reported in interviews at

Amazon
Apple
Facebook
Google
Netflix

We can calculate the efficiency of a Binary Classifier through its confusion matrix. The efficiency of a confusion matrix is defined as the sum of its Sensitivity, Specificity and its Accuracy divided by 3. 

\(Efficiency = {(Sensitivity + Specificity + Accuracy) \over 3}\)

Write a function efficiency(TP,TN,FP,FN) which calculates and returns the efficiency of the binary classifier. 

Here,

TP -> True Positive 

TN -> True Negative

FP -> False Positive

FN -> False Negative

Sample Input:
<class 'list'>
TP: 100
TN: 50
FP: 10
FN: 9

Expected Output:
<class 'float'>
87.94461634969753

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Nihil obcaecati iure necessitatibus architecto harum ut praesentium non eius, vero obcaecati suscipit velit harum ex, tempora numquam voluptatibus cum repellat?

Autem repellendus molestiae expedita molestias nostrum voluptatum, eveniet adipisci iure. Nam deserunt consectetur quasi doloremque ratione dignissimos dolore obcaecati illo dolorum totam, libero nisi dolore inventore expedita eveniet asperiores dolores natus perferendis. Consequuntur libero iste facere mollitia tempora nesciunt quam omnis, facilis rem ullam at iste perspiciatis beatae similique alias necessitatibus provident, voluptatibus recusandae ipsam quam dicta dolorem fuga, natus vitae numquam dolorem iste minima adipisci dolores ab voluptates deserunt itaque, nisi tenetur expedita distinctio voluptatum assumenda. Dolorem atque accusamus quisquam ad illo odio, possimus sequi quisquam maxime rem error nemo voluptas adipisci nihil quidem.

Illo placeat maiores, cumque expedita quae porro neque, quaerat modi ad recusandae numquam?

This is a premium feature.
To access this and other such features, click on upgrade below.

Ready.

Input Test Case

Please enter only one test case at a time
numpy has been already imported as np (import numpy as np)