agreement_categorical()

audpsychometric.agreement_categorical(ratings, *, axis=1)[source]

Confidence score for categorical ratings.

The agreement for categorical data is given by the fraction of raters per item with the rating being equal to the mode given by audpsychometric.mode(). None and nan values are ignored per item.

Parameters
  • ratings (Sequence) – ratings. When given as a 1-dimensional array, it is treated as a row vector

  • axis (int) – axis along which the agreement is computed. A value of 1 assumes stimuli as rows and raters as columns

Return type

Union[float, ndarray]

Returns

categorical agreement score(s)

Examples

>>> agreement_categorical([0, 1])
0.5
>>> agreement_categorical(["a", "b"])
0.5
>>> agreement_categorical([1, 1, np.nan])
1.0