8000 Merge branch 'main' into main · scikit-learn/scikit-learn@f001cf5 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit f001cf5

Browse files
authored
Merge branch 'main' into main
2 parents 537d30f + bff3d7d commit f001cf5

File tree

17 files changed

+144
-77
lines changed

17 files changed

+144
-77
lines changed

doc/modules/linear_model.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ or :func:`lars_path_gram`.
654654
.. rubric:: References
655655

656656
* Original Algorithm is detailed in the paper `Least Angle Regression
657-
<https://www-stat.stanford.edu/~hastie/Papers/LARS/LeastAngle_2002.pdf>`_
657+
<https://hastie.su.domains/Papers/LARS/LeastAngle_2002.pdf>`_
658658
by Hastie et al.
659659

660660
.. _omp:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- Fitting :class:`linear_model.Lasso` and :class:`linear_model.ElasticNet` with
2+
`fit_intercept=True` is faster for sparse input `X` because an unnecessary
3+
re-computation of the sum of residuals is avoided.
4+
By :user:`Christian Lorentzen <lorentzenchr>`
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- Additional `sample_weight` checking has been added to
2+
:func:`metrics.mean_absolute_error`,
3+
:func:`metrics.mean_pinball_loss`,
4+
:func:`metrics.mean_absolute_percentage_error`,
5+
:func:`metrics.mean_squared_error`,
6+
:func:`metrics.root_mean_squared_error`,
7+
:func:`metrics.mean_squared_log_error`,
8+
:func:`metrics.root_mean_squared_log_error`,
9+
:func:`metrics.explained_variance_score`,
10+
:func:`metrics.r2_score`,
11+
:func:`metrics.mean_tweedie_deviance`,
12+
:func:`metrics.mean_poisson_deviance`,
13+
:func:`metrics.mean_gamma_deviance` and
14+
:func:`metrics.d2_tweedie_score`.
15+
`sample_weight` can only be 1D, consistent to `y_true` and `y_pred` in length
16+
or a scalar.
17+
By :user:`Lucy Liu <lucyleeow>`.

examples/miscellaneous/plot_outlier_detection_bench.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,7 @@ def fit_predict(estimator, X):
355355
ax=ax,
356356
plot_chance_level=(model_idx == len(n_neighbors_list) - 1),
357357
chance_level_kw={"linestyle": (0, (1, 10))},
358-
linestyle=linestyle,
359-
linewidth=2,
358+
curve_kwargs=dict(linestyle=linestyle, linewidth=2),
360359
)
361360
_ = ax.set_title("RobustScaler with varying n_neighbors\non forestcover dataset")
362361

@@ -395,8 +394,7 @@ def fit_predict(estimator, X):
395394
ax=ax,
396395
plot_chance_level=(model_idx == len(preprocessor_list) - 1),
397396
chance_level_kw={"linestyle": (0, (1, 10))},
398-
linestyle=linestyle,
399-
linewidth=2,
397+
curve_kwargs=dict(linestyle=linestyle, linewidth=2),
400398
)
401399
_ = ax.set_title("Fixed n_neighbors with varying preprocessing\non forestcover dataset")
402400

@@ -447,8 +445,7 @@ def fit_predict(estimator, X):
447445
ax=ax,
448446
plot_chance_level=(model_idx == len(preprocessor_list) - 1),
449447
chance_level_kw={"linestyle": (0, (1, 10))},
450-
linestyle=linestyle,
451-
linewidth=2,
448+
curve_kwargs=dict(linestyle=linestyle, linewidth=2),
452449
)
453450
ax.set_title(
454451
"Fixed n_neighbors with varying preprocessing\non cardiotocography dataset"

examples/miscellaneous/plot_roc_curve_visualization_api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
rfc = RandomForestClassifier(n_estimators=10, random_state=42)
5555
rfc.fit(X_train, y_train)
5656
ax = plt.gca()
57-
rfc_disp = RocCurveDisplay.from_estimator(rfc, X_test, y_test, ax=ax, alpha=0.8)
58-
svc_disp.plot(ax=ax, alpha=0.8)
57+
rfc_disp = RocCurveDisplay.from_estimator(
58+
rfc, X_test, y_test, ax=ax, curve_kwargs=dict(alpha=0.8)
59+
)
60+
svc_disp.plot(ax=ax, curve_kwargs=dict(alpha=0.8))
5961
plt.show()

examples/model_selection/plot_cost_sensitive_learning.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ def plot_roc_pr_curves(vanilla_model, tuned_model, *, title):
321321
X_test,
322322
y_test,
323323
pos_label=pos_label,
324-
linestyle=linestyle,
325-
color=color,
324+
curve_kwargs=dict(linestyle=linestyle, color=color),
326325
ax=axs[1],
327326
name=name,
328327
plot_chance_level=idx == 1,

examples/model_selection/plot_det.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@
103103
)
104104
clf.fit(X_train, y_train)
105105
RocCurveDisplay.from_estimator(
106-
clf, X_test, y_test, ax=ax_roc, name=name, color=color, linestyle=linestyle
106+
clf,
107+
X_test,
108+
y_test,
109+
ax=ax_roc,
110+
name=name,
111+
curve_kwargs=dict(color=color, linestyle=linestyle),
107112
)
108113
DetCurveDisplay.from_estimator(
109114
clf, X_test, y_test, ax=ax_det, name=name, color=color, linestyle=linestyle

examples/model_selection/plot_roc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
y_onehot_test[:, class_id],
130130
y_score[:, class_id],
131131
name=f"{class_of_interest} vs the rest",
132-
color="darkorange",
132+
curve_kwargs=dict(color="darkorange"),
133133
plot_chance_level=True,
134134
despine=True,
135135
)
@@ -165,7 +165,7 @@
165165
y_onehot_test.ravel(),
166166
y_score.ravel(),
167167
name="micro-average OvR",
168-
color="darkorange",
168+
curve_kwargs=dict(color="darkorange"),
169169
plot_chance_level=True,
170170
despine=True,
171171
)
@@ -290,7 +290,7 @@
290290
y_onehot_test[:, class_id],
291291
y_score[:, class_id],
292292
name=f"ROC curve for {target_names[class_id]}",
293-
color=color,
293+
curve_kwargs=dict(color=color),
294294
ax=ax,
295295
plot_chance_level=(class_id == 2),
296296
despine=True,

examples/model_selection/plot_roc_crossval.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@
8989
X[test],
9090
y[test],
9191
name=f"ROC fold {fold}",
92-
alpha=0.3,
93-
lw=1,
92+
curve_kwargs=dict(alpha=0.3, lw=1),
9493
ax=ax,
9594
plot_chance_level=(fold == n_splits - 1),
9695
)

sklearn/cluster/_bicluster.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ class SpectralCoclustering(BaseSpectral):
307307
array([0, 0], dtype=int32)
308308
>>> clustering
309309
SpectralCoclustering(n_clusters=2, random_state=0)
310+
311+
For a more detailed example, see the following:
312+
:ref:`sphx_glr_auto_examples_bicluster_plot_spectral_coclustering.py`.
310313
"""
311314

312315
_parameter_constraints: dict = {

0 commit comments

Comments
 (0)
0