Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 4 tests #321

Merged
merged 2 commits into from
Sep 14, 2021
Merged

Conversation

mvargas33
Copy link
Contributor

5 Tests were not passing because of make_spd_matrix() function. The usage was incorrect.

According to documentation, you just need to provide n_dim and random_state, in order to generate the random spd matrix.

With this little change, those tests pass

@mvargas33 mvargas33 changed the title Feat fix tests Fix 5 tests Sep 14, 2021
@@ -929,7 +929,7 @@ def test_singleton_class(self):
X = X[[ind_0[0], ind_1[0], ind_2[0]]]
y = y[[ind_0[0], ind_1[0], ind_2[0]]]

A = make_spd_matrix(X.shape[1], X.shape[1])
A = make_spd_matrix(n_dim=X.shape[1], random_state=X.shape[1])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are you observing the failed tests? I see the CI has been passing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From branch master with a fresh virtual environment I got these errors:

FAILED test/metric_learn_test.py::TestSCML::test_iris[lda] - assert 0.255932896034129 < 0.24

FAILED test/metric_learn_test.py::TestNCA::test_one_class - TypeError: make_spd_matrix() takes 1 positional argument but 2 were given

FAILED test/metric_learn_test.py::TestNCA::test_singleton_class - TypeError: make_spd_matrix() takes 1 positional argument but 2 were given

FAILED test/test_mahalanobis_mixin.py::test_init_mahalanobis[MMC] - TypeError: make_spd_matrix() takes 1 positional argument but 2 were given

FAILED test/test_mahalanobis_mixin.py::test_init_mahalanobis[MMC_Supervised] - TypeError: make_spd_matrix() takes 1 positional argument but 2 were given

4 of them are due to make_spd_matrix() function

@mvargas33 mvargas33 changed the title Fix 5 tests Fix 4 tests Sep 14, 2021
@terrytangyuan terrytangyuan merged commit 8583df4 into scikit-learn-contrib:master Sep 14, 2021
@mvargas33 mvargas33 deleted the feat-fix-tests branch October 18, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants