Skip to content

Commit

Permalink
Merge pull request #22 from koaning/issue-20
Browse files Browse the repository at this point in the history
MarginConfidenceReason should punish low margins
  • Loading branch information
koaning committed Dec 7, 2021
2 parents b1cb7d4 + c8ea7de commit 8ff9bdf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions doubtlab/reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __call__(self, X, y):

class MarginConfidenceReason:
"""
Assign doubt when a the difference between the top two most confident classes is too large.
Assign doubt when a the difference between the top two most confident classes is too small.
Throws an error when there are only two classes.
Expand Down Expand Up @@ -191,7 +191,7 @@ def _calc_margin(self, probas):
def __call__(self, X, y):
probas = self.model.predict_proba(X)
margin = self._calc_margin(probas)
return np.where(margin > self.threshold, margin, 0)
return np.where(margin < self.threshold, margin, 0)


class ShortConfidenceReason:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

setup(
name="doubtlab",
version="0.1.2",
version="0.1.3",
author="Vincent D. Warmerdam",
packages=find_packages(exclude=["notebooks", "docs"]),
description="Don't Blindly Trust Your Labels",
Expand Down

0 comments on commit 8ff9bdf

Please sign in to comment.