Skip to content

Commit 053779a

Browse files
Skip single-feature test for SDML
1 parent 81901ee commit 053779a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/test_mahalanobis_mixin.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from metric_learn.sklearn_shims import set_random_state
1616

1717
from metric_learn._util import make_context, _initialize_metric_mahalanobis
18+
from metric_learn.sdml import _BaseSDML
1819
from metric_learn.base_metric import (_QuadrupletsClassifierMixin,
1920
_TripletsClassifierMixin,
2021
_PairsClassifierMixin)
@@ -290,7 +291,11 @@ def test_components_is_2D(estimator, build_dataset):
290291
model.fit(*remove_y(estimator, input_data, labels))
291292
assert model.components_.shape == (X.shape[1], X.shape[1])
292293

293-
# test that it works for 1 feature. Use 2nd dimention, to avoid border cases
294+
if isinstance(estimator, _BaseSDML):
295+
# SDML doesn't support running on a single feature.
296+
return
297+
298+
# test that it works for 1 feature. Use 2nd dimension, to avoid border cases
294299
trunc_data = input_data[..., 1:2]
295300
# we drop duplicates that might have been formed, i.e. of the form
296301
# aabc or abcc or aabb for quadruplets, and aa for pairs.

0 commit comments

Comments
 (0)