Skip to content

Commit 0a1d0a1

Browse files
black (#157)
1 parent c245ff5 commit 0a1d0a1

File tree

7 files changed

+4
-7
lines changed

7 files changed

+4
-7
lines changed

conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
def pytest_collection_modifyitems(config, items):
10-
1110
# numpy changed the str/repr formatting of numpy arrays in 1.14. We want to
1211
# run doctests only for numpy >= 1.14.
1312
skip_doctests = False

examples/cluster/plot_kmedoids_digits.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
plot_cols = 2
6464

6565
for i, (model, description) in enumerate(selected_models):
66-
6766
# Obtain labels for each point in mesh. Use last trained model.
6867
model.fit(reduced_data)
6968
Z = model.predict(np.c_[xx.ravel(), yy.ravel()])

examples/plot_clara_digits.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
plot_cols = 2
8080

8181
for i, (model, description) in enumerate(selected_models):
82-
8382
# Obtain labels for each point in mesh. Use last trained model.
8483
init_time = time.time()
8584
model.fit(reduced_data)

examples/plot_kmedoids.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
plt.cm.Spectral(each) for each in np.linspace(0, 1, len(unique_labels))
3838
]
3939
for k, col in zip(unique_labels, colors):
40-
4140
class_member_mask = labels == k
4241

4342
xy = X[class_member_mask]

sklearn_extra/robust/robust_weighted_estimator.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ def fit(self, X, y=None):
308308

309309
# Optimization algorithm
310310
for epoch in range(self.max_iter):
311-
312311
if self._estimator_type == "classifier":
313312
# If in classification, use decision_function
314313
pred = base_estimator.decision_function(X)
@@ -1016,7 +1015,6 @@ def __init__(
10161015
verbose=0,
10171016
random_state=None,
10181017
):
1019-
10201018
self.weighting = weighting
10211019
self.max_iter = max_iter
10221020
self.c = c

sklearn_extra/robust/tests/test_mean_estimators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
sample = rng.normal(size=100)
1010

11+
1112
# Check good in normal case
1213
def test_normal():
1314
assert np.abs(median_of_means(sample, 3, rng)) < 1e-1

sklearn_extra/robust/tests/test_robust_weighted_estimator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def test_corrupted_classif(loss, weighting, k, c, multi_class):
118118
random_state=rng,
119119
)
120120

121+
121122
# check binary throw an error
122123
def test_robust_estimator_unsupported_loss():
123124
model = RobustWeightedClassifier(multi_class="binary")
@@ -259,7 +260,6 @@ def test_corrupted_regression(loss, weighting, k, c):
259260
@pytest.mark.parametrize("loss", regression_losses)
260261
@pytest.mark.parametrize("weighting", weightings)
261262
def test_corrupted_regression_multidim(loss, weighting):
262-
263263
n = 1000
264264
d = 10
265265

@@ -299,6 +299,7 @@ def test_regression_corrupted_weights(weighting):
299299
y_r = X_r + 0.1 * rng.normal(size=1000)
300300
X_r = X_r.reshape(-1, 1)
301301

302+
302303
# Check that the fit is close to SGD when in extremal parameter cases
303304
@pytest.mark.parametrize("loss", regression_losses)
304305
@pytest.mark.parametrize("weighting", weightings)
@@ -383,6 +384,7 @@ def test_corrupted_cluster(weighting, k, c):
383384
n_samples=100, centers=np.array([[-1, -1], [1, 1]]), random_state=rng
384385
)
385386

387+
386388
# Check that the fit is close to KMeans when in extremal parameter cases
387389
@pytest.mark.parametrize("weighting", weightings)
388390
def test_not_robust_cluster(weighting):

0 commit comments

Comments
 (0)