Skip to content

Commit

Permalink
Rename rater_agreement_pearson() to rater_agreement() (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw authored Aug 30, 2024
1 parent f7296ee commit 2e2e9fe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion audpsychometric/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from audpsychometric.core.gold_standard import agreement_numerical
from audpsychometric.core.gold_standard import evaluator_weighted_estimator
from audpsychometric.core.gold_standard import mode
from audpsychometric.core.gold_standard import rater_agreement_pearson
from audpsychometric.core.gold_standard import rater_agreement
from audpsychometric.core.reliability import congeneric_reliability
from audpsychometric.core.reliability import cronbachs_alpha
from audpsychometric.core.reliability import intra_class_correlation
Expand Down
10 changes: 5 additions & 5 deletions audpsychometric/core/gold_standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def evaluator_weighted_estimator(
"""
ratings = np.array(ratings)
agreements = rater_agreement_pearson(ratings, axis=axis)
agreements = rater_agreement(ratings, axis=axis)
# Ensure columns represents different raters
if axis == 0:
ratings = ratings.T
Expand Down Expand Up @@ -197,15 +197,15 @@ def mode(
)


def rater_agreement_pearson(
def rater_agreement(
ratings: typing.Sequence,
*,
axis: int = 1,
) -> np.ndarray:
"""Calculate rater agreements.
Calculate the agreement of a rater
by the correlation of a rater
by the Pearson correlation of a rater
with the mean score of all other raters.
This should not be confused with the agreement value
Expand All @@ -225,9 +225,9 @@ def rater_agreement_pearson(
rater agreements
Examples:
>>> rater_agreement_pearson([[1, 1, 0], [2, 2, 1]])
>>> rater_agreement([[1, 1, 0], [2, 2, 1]])
array([1., 1., 1.])
>>> rater_agreement_pearson([[1, 1, 0], [2, 2, 1], [2, 2, 2]])
>>> rater_agreement([[1, 1, 0], [2, 2, 1], [2, 2, 2]])
array([0.94491118, 0.94491118, 0.8660254 ])
"""
Expand Down
2 changes: 1 addition & 1 deletion docs/api-src/audpsychometric.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ audpsychometric
intra_class_correlation
list_datasets
mode
rater_agreement_pearson
rater_agreement
read_dataset
4 changes: 2 additions & 2 deletions tests/test_gold_standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def test_agreement_numerical(ratings, minimum, maximum, axis, expected):
)


def test_rater_agreement_pearson(df_holzinger_swineford):
def test_rater_agreement(df_holzinger_swineford):
"""Test rater agreement."""
# there is a very unrealible rater in this set with .24
expected = np.array(
Expand All @@ -170,7 +170,7 @@ def test_rater_agreement_pearson(df_holzinger_swineford):
],
)
np.testing.assert_allclose(
audpsychometric.rater_agreement_pearson(df_holzinger_swineford),
audpsychometric.rater_agreement(df_holzinger_swineford),
expected,
)

Expand Down

0 comments on commit 2e2e9fe

Please sign in to comment.