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

Skip to content

Commit 5b60f4d

Browse files
Mathews-TomMicky774
authored andcommitted
DOC Ensure polynomial_kernel passes numpydoc validation (#23953)
Co-authored-by: Meekail Zain <[email protected]>
1 parent 6ed911a commit 5b60f4d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

sklearn/metrics/pairwise.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,28 +1190,33 @@ def linear_kernel(X, Y=None, dense_output=True):
11901190

11911191
def polynomial_kernel(X, Y=None, degree=3, gamma=None, coef0=1):
11921192
"""
1193-
Compute the polynomial kernel between X and Y::
1193+
Compute the polynomial kernel between X and Y.
11941194
1195-
K(X, Y) = (gamma <X, Y> + coef0)^degree
1195+
:math:`K(X, Y) = (gamma <X, Y> + coef0)^degree`
11961196
11971197
Read more in the :ref:`User Guide <polynomial_kernel>`.
11981198
11991199
Parameters
12001200
----------
12011201
X : ndarray of shape (n_samples_X, n_features)
1202+
A feature array.
12021203
12031204
Y : ndarray of shape (n_samples_Y, n_features), default=None
1205+
An optional second feature array. If `None`, uses `Y=X`.
12041206
12051207
degree : int, default=3
1208+
Kernel degree.
12061209
12071210
gamma : float, default=None
1208-
If None, defaults to 1.0 / n_features.
1211+
Coefficient of the vector inner product. If None, defaults to 1.0 / n_features.
12091212
12101213
coef0 : float, default=1
1214+
Constant offset added to scaled inner product.
12111215
12121216
Returns
12131217
-------
12141218
Gram matrix : ndarray of shape (n_samples_X, n_samples_Y)
1219+
The polynomial kernel.
12151220
"""
12161221
X, Y = check_pairwise_arrays(X, Y)
12171222
if gamma is None:

sklearn/tests/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"sklearn.metrics.cluster._supervised.rand_score",
4949
"sklearn.metrics.cluster._supervised.v_measure_score",
5050
"sklearn.metrics.pairwise.pairwise_distances_chunked",
51-
"sklearn.metrics.pairwise.polynomial_kernel",
5251
"sklearn.preprocessing._data.maxabs_scale",
5352
"sklearn.preprocessing._data.scale",
5453
"sklearn.preprocessing._label.label_binarize",

0 commit comments

Comments
 (0)