Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
22 changes: 22 additions & 0 deletions doc/whats_new/v1.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ Changelog
:mod:`sklearn.cluster`
......................

- |Fix| The `degree` parameter in the :class:`cluster.SpectralClustering`
constructor now accepts real values instead of only integral values in
accordance with the `degree` parameter of the
:class:`sklearn.metrics.pairwise.polynomial_kernel`. :pr:`27668` by
:user:`Nolan McMahon <NolantheNerd>`.

- |API| `kdtree` and `balltree` values are now deprecated and are renamed as
`kd_tree` and `ball_tree` respectively for the `algorithm` parameter of
:class:`cluster.HDBSCAN` ensuring consistency in naming convention.
Expand Down Expand Up @@ -304,6 +310,12 @@ Changelog
- |Fix| :func:`decomposition.dict_learning_online` does not ignore anymore the parameter
`max_iter`.
:pr:`27834` by :user:`Guillaume Lemaitre <glemaitre>`.

- |Fix| The `degree` parameter in the :class:`decomposition.KernelPCA`
constructor now accepts real values instead of only integral values in
accordance with the `degree` parameter of the
:class:`sklearn.metrics.pairwise.polynomial_kernel`. :pr:`27668` by
:user:`Nolan McMahon <NolantheNerd>`.

- |API| The option `max_iter=None` in
:class:`decomposition.MiniBatchDictionaryLearning`,
Expand Down Expand Up @@ -398,6 +410,16 @@ Changelog
of a `ValueError` when an estimator does not implement the requested response method.
:pr:`27291` by :user:`Guillaume Lemaitre <glemaitre>`.

:mod:`sklearn.kernel_ridge`
...........................

- |Fix| The `degree` parameter in the :class:`kernel_ridge.KernelRidge`
constructor now accepts real values instead of only integral values in
accordance with the `degree` parameter of the
:class:`sklearn.metrics.pairwise.polynomial_kernel`. :pr:`27668` by
:user:`Nolan McMahon <NolantheNerd>`.


:mod:`sklearn.linear_model`
...........................

Expand Down
2 changes: 1 addition & 1 deletion sklearn/cluster/_spectral.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ class SpectralClustering(ClusterMixin, BaseEstimator):
StrOptions({"auto"}),
],
"assign_labels": [StrOptions({"kmeans", "discretize", "cluster_qr"})],
"degree": [Interval(Integral, 0, None, closed="left")],
"degree": [Interval(Real, 0, None, closed="left")],
"coef0": [Interval(Real, None, None, closed="neither")],
"kernel_params": [dict, None],
"n_jobs": [Integral, None],
Expand Down
4 changes: 2 additions & 2 deletions sklearn/decomposition/_kernel_pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class KernelPCA(ClassNamePrefixFeaturesOutMixin, TransformerMixin, BaseEstimator
Kernel coefficient for rbf, poly and sigmoid kernels. Ignored by other
kernels. If ``gamma`` is ``None``, then it is set to ``1/n_features``.

degree : int, default=3
degree : float, default=3
Degree for poly kernels. Ignored by other kernels.

coef0 : float, default=1
Expand Down Expand Up @@ -251,7 +251,7 @@ class KernelPCA(ClassNamePrefixFeaturesOutMixin, TransformerMixin, BaseEstimator
Interval(Real, 0, None, closed="left"),
None,
],
"degree": [Interval(Integral, 0, None, closed="left")],
"degree": [Interval(Real, 0, None, closed="left")],
"coef0": [Interval(Real, None, None, closed="neither")],
"kernel_params": [dict, None],
"alpha": [Interval(Real, 0, None, closed="left")],
Expand Down
6 changes: 3 additions & 3 deletions sklearn/kernel_ridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Authors: Mathieu Blondel <[email protected]>
# Jan Hendrik Metzen <[email protected]>
# License: BSD 3 clause
from numbers import Integral, Real
from numbers import Real

import numpy as np

Expand Down Expand Up @@ -69,7 +69,7 @@ class KernelRidge(MultiOutputMixin, RegressorMixin, BaseEstimator):
the kernel; see the documentation for sklearn.metrics.pairwise.
Ignored by other kernels.

degree : int, default=3
degree : float, default=3
Degree of the polynomial kernel. Ignored by other kernels.

coef0 : float, default=1
Expand Down Expand Up @@ -138,7 +138,7 @@ class KernelRidge(MultiOutputMixin, RegressorMixin, BaseEstimator):
callable,
],
"gamma": [Interval(Real, 0, None, closed="left"), None],
"degree": [Interval(Integral, 0, None, closed="left")],
"degree": [Interval(Real, 0, None, closed="left")],
"coef0": [Interval(Real, None, None, closed="neither")],
"kernel_params": [dict, None],
}
Expand Down