Skip to content

Commit cb82ceb

Browse files
rosecersagoscinski
andcommitted
Apply suggestions from code review
Co-authored-by: Alexander Goscinski <[email protected]>
1 parent 0aa2699 commit cb82ceb

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/skmatter/_selection.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,9 @@ def transform(self, X, y=None):
241241
The selected subset of the input.
242242
"""
243243

244-
if self.axis == 0:
244+
check_is_fitted(self, ["_axis", "selected_idx_", "n_selected_"])
245+
246+
if self._axis == 0:
245247
raise ValueError(
246248
"Transform is not currently supported for sample selection."
247249
)
@@ -251,7 +253,7 @@ def transform(self, X, y=None):
251253
X = check_array(X)
252254

253255
if len(X.shape) == 1:
254-
if self.axis == 0:
256+
if self._axis == 0:
255257
X = X.reshape(-1, 1)
256258
else:
257259
X = X.reshape(1, -1)

tests/test_greedy_selector.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def test_bad_warm_start(self):
6262
def test_bad_y(self):
6363
self.X, self.Y = get_dataset(return_X_y=True)
6464
Y = self.Y[:2]
65-
print(self.X.shape, Y.shape)
6665
selector = GreedyTester(n_to_select=2)
6766
with self.assertRaises(ValueError):
6867
selector.fit(X=self.X, y=Y)

tests/test_orthogonalizers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,10 @@ def test_copy(self):
152152
-1, 1, size=(self.n_samples, self.n_features)
153153
)
154154

155-
print(X_random)
156155
idx = self.random_state.choice(X_random.shape[-1])
157156

158157
new_X = X_orthogonalizer(X_random, idx, tol=EPSILON, copy=True)
159158
X_orthogonalizer(X_random, idx, tol=EPSILON, copy=False)
160-
print(new_X, X_random)
161159
self.assertTrue(np.allclose(X_random, new_X))
162160

163161

0 commit comments

Comments
 (0)