Skip to content

MAINT fix circleCI #157

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

Merged
merged 1 commit into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def pytest_collection_modifyitems(config, items):

# numpy changed the str/repr formatting of numpy arrays in 1.14. We want to
# run doctests only for numpy >= 1.14.
skip_doctests = False
Expand Down
1 change: 0 additions & 1 deletion examples/cluster/plot_kmedoids_digits.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
plot_cols = 2

for i, (model, description) in enumerate(selected_models):

# Obtain labels for each point in mesh. Use last trained model.
model.fit(reduced_data)
Z = model.predict(np.c_[xx.ravel(), yy.ravel()])
Expand Down
1 change: 0 additions & 1 deletion examples/plot_clara_digits.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
plot_cols = 2

for i, (model, description) in enumerate(selected_models):

# Obtain labels for each point in mesh. Use last trained model.
init_time = time.time()
model.fit(reduced_data)
Expand Down
1 change: 0 additions & 1 deletion examples/plot_kmedoids.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
plt.cm.Spectral(each) for each in np.linspace(0, 1, len(unique_labels))
]
for k, col in zip(unique_labels, colors):

class_member_mask = labels == k

xy = X[class_member_mask]
Expand Down
2 changes: 0 additions & 2 deletions sklearn_extra/robust/robust_weighted_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ def fit(self, X, y=None):

# Optimization algorithm
for epoch in range(self.max_iter):

if self._estimator_type == "classifier":
# If in classification, use decision_function
pred = base_estimator.decision_function(X)
Expand Down Expand Up @@ -1016,7 +1015,6 @@ def __init__(
verbose=0,
random_state=None,
):

self.weighting = weighting
self.max_iter = max_iter
self.c = c
Expand Down
1 change: 1 addition & 0 deletions sklearn_extra/robust/tests/test_mean_estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

sample = rng.normal(size=100)


# Check good in normal case
def test_normal():
assert np.abs(median_of_means(sample, 3, rng)) < 1e-1
Expand Down
4 changes: 3 additions & 1 deletion sklearn_extra/robust/tests/test_robust_weighted_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def test_corrupted_classif(loss, weighting, k, c, multi_class):
random_state=rng,
)


# check binary throw an error
def test_robust_estimator_unsupported_loss():
model = RobustWeightedClassifier(multi_class="binary")
Expand Down Expand Up @@ -259,7 +260,6 @@ def test_corrupted_regression(loss, weighting, k, c):
@pytest.mark.parametrize("loss", regression_losses)
@pytest.mark.parametrize("weighting", weightings)
def test_corrupted_regression_multidim(loss, weighting):

n = 1000
d = 10

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


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


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