Skip to content

Commit 8571f97

Browse files
authored
SCML iris test refactor [Minor] (#332)
* Add venv to gitignore * Create yml draft Trying to run tests with github actions * Update yml * Update 2 * Update 3 * YML: Only Python3 versions * Add Codecov to CI * Mirroring actual yml from metric_learning repo * Fix codecov * Fix old scikit learn * Update yml * Remove 3.9 from compatibility * Fixed issue with sklearn 0.20 * Delete comments, and unnecesary workflow_dispatch * SCML test refactor * Commented te test
1 parent f548b1e commit 8571f97

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/metric_learn_test.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,17 @@ def test_singular_returns_pseudo_inverse(self):
7979
class TestSCML(object):
8080
@pytest.mark.parametrize('basis', ('lda', 'triplet_diffs'))
8181
def test_iris(self, basis):
82+
"""
83+
SCML applied to Iris dataset should give better results when
84+
computing class separation.
85+
"""
8286
X, y = load_iris(return_X_y=True)
87+
before = class_separation(X, y)
8388
scml = SCML_Supervised(basis=basis, n_basis=85, k_genuine=7, k_impostor=5,
8489
random_state=42)
8590
scml.fit(X, y)
86-
csep = class_separation(scml.transform(X), y)
87-
assert csep < 0.24
91+
after = class_separation(scml.transform(X), y)
92+
assert before > after + 0.03 # It's better by a margin of 0.03
8893

8994
def test_big_n_features(self):
9095
X, y = make_classification(n_samples=100, n_classes=3, n_features=60,

0 commit comments

Comments
 (0)