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

Skip to content

Commit d3b740a

Browse files
authored
DOC Ensures that check_pairwise_arrays and pairwise_kernel pass numpydoc validation (#23519)
1 parent ed09c05 commit d3b740a

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

sklearn/metrics/pairwise.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ def check_pairwise_arrays(
135135
safe_Y : {array-like, sparse matrix} of shape (n_samples_Y, n_features)
136136
An array equal to Y if Y was not None, guaranteed to be a numpy array.
137137
If Y was None, safe_Y will be a pointer to X.
138-
139138
"""
140139
X, Y, dtype_float = _return_float_dtype(X, Y)
141140

@@ -1508,7 +1507,6 @@ def distance_metrics():
15081507
=============== ========================================
15091508
15101509
Read more in the :ref:`User Guide <metrics>`.
1511-
15121510
"""
15131511
return PAIRWISE_DISTANCE_FUNCTIONS
15141512

@@ -2082,8 +2080,7 @@ def pairwise_kernels(
20822080
20832081
Parameters
20842082
----------
2085-
X : ndarray of shape (n_samples_X, n_samples_X) or \
2086-
(n_samples_X, n_features)
2083+
X : ndarray of shape (n_samples_X, n_samples_X) or (n_samples_X, n_features)
20872084
Array of pairwise kernels between samples, or a feature array.
20882085
The shape of the array should be (n_samples_X, n_samples_X) if
20892086
metric == "precomputed" and (n_samples_X, n_features) otherwise.
@@ -2121,8 +2118,7 @@ def pairwise_kernels(
21212118
21222119
Returns
21232120
-------
2124-
K : ndarray of shape (n_samples_X, n_samples_X) or \
2125-
(n_samples_X, n_samples_Y)
2121+
K : ndarray of shape (n_samples_X, n_samples_X) or (n_samples_X, n_samples_Y)
21262122
A kernel matrix K such that K_{i, j} is the kernel between the
21272123
ith and jth vectors of the given matrix X, if Y is None.
21282124
If Y is not None, then K_{i, j} is the kernel between the ith array
@@ -2131,7 +2127,6 @@ def pairwise_kernels(
21312127
Notes
21322128
-----
21332129
If metric is 'precomputed', Y is ignored and X is returned.
2134-
21352130
"""
21362131
# import GPKernel locally to prevent circular imports
21372132
from ..gaussian_process.kernels import Kernel as GPKernel

sklearn/tests/test_docstrings.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"sklearn.metrics.cluster._supervised.v_measure_score",
5757
"sklearn.metrics.pairwise.additive_chi2_kernel",
5858
"sklearn.metrics.pairwise.check_paired_arrays",
59-
"sklearn.metrics.pairwise.check_pairwise_arrays",
6059
"sklearn.metrics.pairwise.chi2_kernel",
6160
"sklearn.metrics.pairwise.cosine_distances",
6261
"sklearn.metrics.pairwise.cosine_similarity",
@@ -66,7 +65,6 @@
6665
"sklearn.metrics.pairwise.pairwise_distances_argmin",
6766
"sklearn.metrics.pairwise.pairwise_distances_argmin_min",
6867
"sklearn.metrics.pairwise.pairwise_distances_chunked",
69-
"sklearn.metrics.pairwise.pairwise_kernels",
7068
"sklearn.metrics.pairwise.polynomial_kernel",
7169
"sklearn.metrics.pairwise.rbf_kernel",
7270
"sklearn.metrics.pairwise.sigmoid_kernel",

0 commit comments

Comments
 (0)