Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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