Skip to content

Commit 095e466

Browse files
DOC Ensure rbf_kernel passes numpydoc validation (#23954)
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
1 parent 96e5f25 commit 095e466

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sklearn/metrics/pairwise.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,8 +1260,7 @@ def sigmoid_kernel(X, Y=None, gamma=None, coef0=1):
12601260

12611261

12621262
def rbf_kernel(X, Y=None, gamma=None):
1263-
"""
1264-
Compute the rbf (gaussian) kernel between X and Y::
1263+
"""Compute the rbf (gaussian) kernel between X and Y.
12651264
12661265
K(x, y) = exp(-gamma ||x-y||^2)
12671266
@@ -1272,16 +1271,18 @@ def rbf_kernel(X, Y=None, gamma=None):
12721271
Parameters
12731272
----------
12741273
X : ndarray of shape (n_samples_X, n_features)
1274+
A feature array.
12751275
12761276
Y : ndarray of shape (n_samples_Y, n_features), default=None
1277-
If `None`, uses `Y=X`.
1277+
An optional second feature array. If `None`, uses `Y=X`.
12781278
12791279
gamma : float, default=None
12801280
If None, defaults to 1.0 / n_features.
12811281
12821282
Returns
12831283
-------
12841284
kernel_matrix : ndarray of shape (n_samples_X, n_samples_Y)
1285+
The RBF kernel.
12851286
"""
12861287
X, Y = check_pairwise_arrays(X, Y)
12871288
if gamma is None:

sklearn/tests/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"sklearn.metrics.cluster._supervised.v_measure_score",
5050
"sklearn.metrics.pairwise.pairwise_distances_chunked",
5151
"sklearn.metrics.pairwise.polynomial_kernel",
52-
"sklearn.metrics.pairwise.rbf_kernel",
5352
"sklearn.metrics.pairwise.sigmoid_kernel",
5453
"sklearn.preprocessing._data.maxabs_scale",
5554
"sklearn.preprocessing._data.scale",

0 commit comments

Comments
 (0)