Created
August 5, 2019 20:59
-
-
Save mattiasostmar/42b0d846a2e3db6d8afa92e6f90d445b to your computer and use it in GitHub Desktop.
Python code to compute accuracy and Cohens Kappa
This file contains 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
[in:] | |
tot_accuracy = sum(test['func'] == test['predicted']) / len(test) | |
print("Accuracy all 8 classes together: {}".format(tot_accuracy)) | |
# Total Cohens Kappa | |
tot_kappa = (fe_accuracy - 0.125) / 0.125 | |
print("Cohens Kappa all 8 classes together: {}".format(tot_kappa)) | |
[out:] | |
Accuracy all 8 classes together: 0.8285714285714286 | |
Cohens Kappa all 8 classes together: 5.628571428571429 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment