diff --git a/.gitignore b/.gitignore index 8321c7d2..16917890 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ htmlcov/ .cache/ .pytest_cache/ doc/auto_examples/* -doc/generated/* \ No newline at end of file +doc/generated/* +venv/ \ No newline at end of file diff --git a/test/metric_learn_test.py b/test/metric_learn_test.py index 5cae80f2..4d058c8d 100644 --- a/test/metric_learn_test.py +++ b/test/metric_learn_test.py @@ -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]) nca = NCA(init=A, max_iter=30, n_components=X.shape[1]) nca.fit(X, y) assert_array_equal(nca.components_, A) @@ -940,7 +940,7 @@ def test_one_class(self): X = self.iris_points[self.iris_labels == 0] y = self.iris_labels[self.iris_labels == 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]) nca = NCA(init=A, max_iter=30, n_components=X.shape[1]) nca.fit(X, y) assert_array_equal(nca.components_, A) diff --git a/test/test_mahalanobis_mixin.py b/test/test_mahalanobis_mixin.py index 84058b32..e3d981a4 100644 --- a/test/test_mahalanobis_mixin.py +++ b/test/test_mahalanobis_mixin.py @@ -503,12 +503,12 @@ def test_init_mahalanobis(estimator, build_dataset): model.fit(input_data, labels) # Initialize with a random spd matrix - init = make_spd_matrix(X.shape[1], random_state=rng) + init = make_spd_matrix(n_dim=X.shape[1], random_state=rng) model.set_params(**{param: init}) model.fit(input_data, labels) # init.shape[1] must match X.shape[1] - init = make_spd_matrix(X.shape[1] + 1, X.shape[1] + 1) + init = make_spd_matrix(n_dim=X.shape[1] + 1, random_state=rng) model.set_params(**{param: init}) msg = ('The input dimensionality {} of the given ' 'mahalanobis matrix `{}` must match the '