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

Skip to content

DOC Ensures that nan_euclidean_distances passes numpydoc #22140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
21 changes: 13 additions & 8 deletions sklearn/metrics/pairwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,12 @@ def nan_euclidean_distances(

Parameters
----------
X : array-like of shape=(n_samples_X, n_features)
X : array-like of shape (n_samples_X, n_features)
An array where each row is a sample and each column is a feature.

Y : array-like of shape=(n_samples_Y, n_features), default=None
An array where each row is a sample and each column is a feature.
If `None`, method uses `Y=X`.

squared : bool, default=False
Return squared Euclidean distances.
Expand All @@ -427,11 +430,20 @@ def nan_euclidean_distances(
Returns
-------
distances : ndarray of shape (n_samples_X, n_samples_Y)
Returns the distances between the row vectors of `X`
and the row vectors of `Y`.

See Also
--------
paired_distances : Distances between pairs of elements of X and Y.

References
----------
* John K. Dixon, "Pattern Recognition with Partly Missing Data",
IEEE Transactions on Systems, Man, and Cybernetics, Volume: 9, Issue:
10, pp. 617 - 621, Oct. 1979.
http://ieeexplore.ieee.org/abstract/document/4310090/

Examples
--------
>>> from sklearn.metrics.pairwise import nan_euclidean_distances
Expand All @@ -445,13 +457,6 @@ def nan_euclidean_distances(
>>> nan_euclidean_distances(X, [[0, 0]])
array([[1. ],
[1.41421356]])

References
----------
* John K. Dixon, "Pattern Recognition with Partly Missing Data",
IEEE Transactions on Systems, Man, and Cybernetics, Volume: 9, Issue:
10, pp. 617 - 621, Oct. 1979.
http://ieeexplore.ieee.org/abstract/document/4310090/
"""

force_all_finite = "allow-nan" if is_scalar_nan(missing_values) else True
Expand Down
1 change: 0 additions & 1 deletion sklearn/tests/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
"sklearn.metrics.pairwise.kernel_metrics",
"sklearn.metrics.pairwise.laplacian_kernel",
"sklearn.metrics.pairwise.manhattan_distances",
"sklearn.metrics.pairwise.nan_euclidean_distances",
"sklearn.metrics.pairwise.paired_cosine_distances",
"sklearn.metrics.pairwise.paired_distances",
"sklearn.metrics.pairwise.paired_euclidean_distances",
Expand Down