8000 MNT `ruff format` · scikit-learn/scikit-learn@d3bfa00 · GitHub
[go: up one dir, main page]

Skip to content

Commit d3bfa00

Browse files
MNT ruff format
1 parent e6d97c3 commit d3bfa00

File tree

57 files changed

+194
-211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+194
-211
lines changed

benchmarks/bench_hist_gradient_boosting_adult.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def predict(est, data_test, target_test):
4646
toc = time()
4747
roc_auc = roc_auc_score(target_test, predicted_proba_test[:, 1])
4848
acc = accuracy_score(target_test, predicted_test)
49-
print(f"predicted in {toc - tic:.3f}s, ROC AUC: {roc_auc:.4f}, ACC: {acc :.4f}")
49+
print(f"predicted in {toc - tic:.3f}s, ROC AUC: {roc_auc:.4f}, ACC: {acc:.4f}")
5050

5151

5252
data = fetch_openml(data_id=179, as_frame=True) # adult dataset

benchmarks/bench_hist_gradient_boosting_higgsboson.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def predict(est, data_test, target_test):
7474
toc = time()
7575
roc_auc = roc_auc_score(target_test, predicted_proba_test[:, 1])
7676
acc = accuracy_score(target_test, predicted_test)
77-
print(f"predicted in {toc - tic:.3f}s, ROC AUC: {roc_auc:.4f}, ACC: {acc :.4f}")
77+
print(f"predicted in {toc - tic:.3f}s, ROC AUC: {roc_auc:.4f}, ACC: {acc:.4f}")
7878

7979

8080
df = load_data()

build_tools/get_comment.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ def get_step_message(log, start, end, title, message, details):
5555
if end not in log:
5656
return ""
5757
res = (
58-
"-----------------------------------------------\n"
59-
f"### {title}\n\n"
60-
f"{message}\n\n"
58+
f"-----------------------------------------------\n### {title}\n\n{message}\n\n"
6159
)
6260
if details:
6361
res += (

examples/applications/plot_species_distribution_modeling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def create_species_bunch(species_name, train, test, coverages, xgrid, ygrid):
109109

110110

111111
def plot_species_distribution(
112-
species=("bradypus_variegatus_0", "microryzomys_minutus_0")
112+
species=("bradypus_variegatus_0", "microryzomys_minutus_0"),
113113
):
114114
"""
115115
Plot the species distribution.

examples/applications/plot_time_series_lagged_features.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def consolidate_scores(cv_results, scores, metric):
265265
time = cv_results["fit_time"]
266266
scores["fit_time"].append(f"{time.mean():.2f} ± {time.std():.2f} s")
267267

268-
scores["loss"].append(f"quantile {int(quantile*100)}")
268+
scores["loss"].append(f"quantile {int(quantile * 100)}")
269269
for key, value in cv_results.items():
270270
if key.startswith("test_"):
271271
metric = key.split("test_")[1]

examples/applications/plot_topics_extraction_with_nmf_lda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def plot_top_words(model, feature_names, n_top_words, title):
5050

5151
ax = axes[topic_idx]
5252
ax.barh(top_features, weights, height=0.7)
53-
ax.set_title(f"Topic {topic_idx +1}", fontdict={"fontsize": 30})
53+
ax.set_title(f"Topic {topic_idx + 1}", fontdict={"fontsize": 30})
5454
ax.tick_params(axis="both", which="major", labelsize=20)
5555
for i in "top right left".split():
5656
ax.spines[i].set_visible(False)

examples/linear_model/plot_tweedie_regression_insurance_claims.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,9 @@ def score_estimator(
606606
"predicted, frequency*severity model": np.sum(
607607
exposure * glm_freq.predict(X) * glm_sev.predict(X)
608608
),
609-
"predicted, tweedie, power=%.2f"
610-
% glm_pure_premium.power: np.sum(exposure * glm_pure_premium.predict(X)),
609+
"predicted, tweedie, power=%.2f" % glm_pure_premium.power: np.sum(
610+
exposure * glm_pure_premium.predict(X)
611+
),
611612
}
612613
)
613614

examples/manifold/plot_lle_digits.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# Authors: The scikit-learn developers
1111
# SPDX-License-Identifier: BSD-3-Clause
1212

13-
1413
# %%
1514
# Load digits dataset
1615
# -------------------

examples/manifold/plot_manifold_sphere.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
t = random_state.rand(n_samples) * np.pi
5151

5252
# Sever the poles from the sphere.
53-
indices = (t < (np.pi - (np.pi / 8))) & (t > ((np.pi / 8)))
53+
indices = (t < (np.pi - (np.pi / 8))) & (t > (np.pi / 8))
5454
colors = p[indices]
5555
x, y, z = (
5656
np.sin(t[indices]) * np.cos(p[indices]),

examples/model_selection/plot_likelihood_ratios.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class proportion than the target application.
4040
from sklearn.datasets import make_classification
4141

4242
X, y = make_classification(n_samples=10_000, weights=[0.9, 0.1], random_state=0)
43-
print(f"Percentage of people carrying the disease: {100*y.mean():.2f}%")
43+
print(f"Percentage of people carrying the disease: {100 * y.mean():.2f}%")
4444

4545
# %%
4646
# A machine learning model is built to diagnose if a person with some given

0 commit comments

Comments
 (0)
0