Skip to content

Commit

Permalink
Correction to Peirce Skill Score formula (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
tennlee authored Jun 2, 2024
1 parent 5c8e4ed commit 5f79337
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

project = "scores"
copyright = "Licensed under Apache 2.0 - https://www.apache.org/licenses/LICENSE-2.0"
release = "0.8.2"
release = "0.8.3"

version = __version__

Expand Down
2 changes: 1 addition & 1 deletion src/scores/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import scores.sample_data
import scores.stats.statistical_tests # noqa: F401

__version__ = "0.8.2"
__version__ = "0.8.3"

__all__ = [
"scores.categorical",
Expand Down
2 changes: 1 addition & 1 deletion src/scores/categorical/contingency_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def peirce_skill_score(self):
"""
cd = self.counts
component_a = cd["tp_count"] / (cd["tp_count"] + cd["fn_count"])
component_b = cd["fn_count"] / (cd["fn_count"] + cd["tn_count"])
component_b = cd["fp_count"] / (cd["fp_count"] + cd["tn_count"])
skill_score = component_a - component_b
return skill_score

Expand Down
2 changes: 1 addition & 1 deletion tests/categorical/test_contingency.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def test_categorical_table():
assert table.yules_q() == table.odds_ratio_skill_score()

peirce_component_a = 9 / (9 + 1)
peirce_component_b = 1 / (1 + 6)
peirce_component_b = 2 / (2 + 6)
peirce_expected = peirce_component_a - peirce_component_b
assert table.peirce_skill_score() == peirce_expected

Expand Down

0 comments on commit 5f79337

Please sign in to comment.