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

Skip to content

Commit 97057d3

Browse files
DOC Ensures that svd_flip passes numpydoc validation (#24581)
Co-authored-by: Thomas J. Fan <[email protected]>
1 parent b0b7c15 commit 97057d3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

sklearn/tests/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
FUNCTION_DOCSTRING_IGNORE_LIST = [
1515
"sklearn.utils.extmath.fast_logdet",
1616
"sklearn.utils.extmath.randomized_svd",
17-
"sklearn.utils.extmath.svd_flip",
1817
"sklearn.utils.gen_batches",
1918
"sklearn.utils.metaestimators.if_delegate_has_method",
2019
]

sklearn/utils/extmath.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -740,12 +740,12 @@ def svd_flip(u, v, u_based_decision=True):
740740
Parameters
741741
----------
742742
u : ndarray
743-
u and v are the output of `linalg.svd` or
743+
Parameters u and v are the output of `linalg.svd` or
744744
:func:`~sklearn.utils.extmath.randomized_svd`, with matching inner
745745
dimensions so one can compute `np.dot(u * s, v)`.
746746
747747
v : ndarray
748-
u and v are the output of `linalg.svd` or
748+
Parameters u and v are the output of `linalg.svd` or
749749
:func:`~sklearn.utils.extmath.randomized_svd`, with matching inner
750750
dimensions so one can compute `np.dot(u * s, v)`.
751751
The input v should really be called vt to be consistent with scipy's
@@ -756,11 +756,13 @@ def svd_flip(u, v, u_based_decision=True):
756756
Otherwise, use the rows of v. The choice of which variable to base the
757757
decision on is generally algorithm dependent.
758758
759-
760759
Returns
761760
-------
762-
u_adjusted, v_adjusted : arrays with the same dimensions as the input.
761+
u_adjusted : ndarray
762+
Array u with adjusted columns and the same dimensions as u.
763763
764+
v_adjusted : ndarray
765+
Array v with adjusted rows and the same dimensions as v.
764766
"""
765767
if u_based_decision:
766768
# columns of u, rows of v

0 commit comments

Comments
 (0)