Skip to content

Commit

Permalink
SCML iris test refactor [Minor] (#332)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mvargas33 authored Oct 1, 2021
1 parent f548b1e commit 8571f97
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/metric_learn_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,17 @@ def test_singular_returns_pseudo_inverse(self):
class TestSCML(object):
@pytest.mark.parametrize('basis', ('lda', 'triplet_diffs'))
def test_iris(self, basis):
"""
SCML applied to Iris dataset should give better results when
computing class separation.
"""
X, y = load_iris(return_X_y=True)
before = class_separation(X, y)
scml = SCML_Supervised(basis=basis, n_basis=85, k_genuine=7, k_impostor=5,
random_state=42)
scml.fit(X, y)
csep = class_separation(scml.transform(X), y)
assert csep < 0.24
after = class_separation(scml.transform(X), y)
assert before > after + 0.03 # It's better by a margin of 0.03

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

0 comments on commit 8571f97

Please sign in to comment.