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
def fleiss_kappa(M): | |
""" | |
See `Fleiss' Kappa <https://en.wikipedia.org/wiki/Fleiss%27_kappa>`_. | |
:param M: a matrix of shape (:attr:`N`, :attr:`k`) where `N` is the number of subjects and `k` is the number of categories into which assignments are made. `M[i, j]` represent the number of raters who assigned the `i`th subject to the `j`th category. | |
:type M: numpy matrix | |
""" | |
N, k = M.shape # N is # of items, k is # of categories | |
n_annotators = float(np.sum(M[0, :])) # # of annotators |
OlderNewer