Skip to content

Commit

Permalink
isclose in adjust test
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrenodet committed Nov 29, 2024
1 parent b13d61c commit e902e58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9

- run: pip install --upgrade hatch
- run: hatch fmt --check
- run: hatch test --cover
4 changes: 3 additions & 1 deletion tests/probe/test_adjust.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# see the "LICENSE.md" file for more details
# or https://github.com/Orange-OpenSource/mislabeled/blob/master/LICENSE.md

import math

import numpy as np
from sklearn.datasets import make_moons
from sklearn.linear_model import LogisticRegression
Expand All @@ -23,4 +25,4 @@ def test_means_per_class_when_adjusted_are_equals():
confidence = Confidence(Adjust(Probabilities()))
c = confidence(logreg, X, y)

assert np.mean(c[y == 0]) == np.mean(c[y == 1])
assert math.isclose(np.mean(c[y == 0]), np.mean(c[y == 1]))

0 comments on commit e902e58

Please sign in to comment.