Skip to content

Commit

Permalink
FIX incorrect test (scikit-learn-contrib#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopfonseca committed Dec 19, 2021
1 parent 467c557 commit 2e6a2d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions imblearn/over_sampling/_smote/tests/test_geometric_smote.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def test_gsmote_fit_resample_binary(
n_maj, n_min, step, min_coor, max_coor = 12, 5, 0.5, 0.0, 8.5
X = np.repeat(np.arange(min_coor, max_coor, step), 2).reshape(-1, 2)
y = np.concatenate([np.repeat(0, n_maj), np.repeat(1, n_min)])
radius = np.sqrt(0.5) * step
max_radius = np.sqrt(np.sum((X[-1] - X[n_maj - 1]) ** 2))
k_neighbors = 1
gsmote = GeometricSMOTE(
"auto",
Expand All @@ -170,7 +170,7 @@ def test_gsmote_fit_resample_binary(
X_resampled, y_resampled = gsmote.fit_resample(X, y)
assert gsmote.sampling_strategy_ == {1: (n_maj - n_min)}
assert y_resampled.sum() == n_maj
np.testing.assert_array_less(X[n_maj - 1] - radius, X_resampled[n_maj + n_min])
np.testing.assert_array_less(X[-1] - max_radius, X_resampled[n_maj + n_min])


@pytest.mark.parametrize(
Expand Down

0 comments on commit 2e6a2d7

Please sign in to comment.