Created
December 10, 2013 18:20
-
-
Save agarie/7895354 to your computer and use it in GitHub Desktop.
Matthews correlation coefficient. I'll never have to reimplement this!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def matthews(tp, tn, fp, fn) | |
den = tp * tn - fp * fn | |
num = (tp + fp) * (tp + fn) * (tn + fp) * (tn + fn) | |
den / Math.sqrt(num) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment