10000 DOC Ensures that PLSSVD passes numpydoc validation (#21198) · scikit-learn/scikit-learn@2d4edc7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2d4edc7

Browse files
authored
DOC Ensures that PLSSVD passes numpydoc validation (#21198)
1 parent 8bb1a43 commit 2d4edc7

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

maint_tools/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"OrthogonalMatchingPursuit",
2323
"OrthogonalMatchingPursuitCV",
2424
"PLSRegression",
25-
"PLSSVD",
2625
"PassiveAggressiveClassifier",
2726
"PassiveAggressiveRegressor",
2827
"PatchExtractor",

sklearn/cross_decomposition/_pls.py

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -910,10 +910,10 @@ def __init__(
910910
class PLSSVD(TransformerMixin, BaseEstimator):
911911
"""Partial Least Square SVD.
912912
913-
This transformer simply performs a SVD on the crosscovariance matrix X'Y.
914-
It is able to project both the training data `X` and the targets `Y`. The
915-
training data X is projected on the left singular vectors, while the
916-
targets are projected on the right singular vectors.
913+
This transformer simply performs a SVD on the cross-covariance matrix
914+
`X'Y`. It is able to project both the training data `X` and the targets
915+
`Y`. The training data `X` is projected on the left singular vectors, while
916+
the targets are projected on the right singular vectors.
917917
918918
Read more in the :ref:`User Guide <cross_decomposition>`.
919919
@@ -930,18 +930,18 @@ class PLSSVD(TransformerMixin, BaseEstimator):
930930
931931
copy : bool, default=True
932932
Whether to copy `X` and `Y` in fit before applying centering, and
933-
potentially scaling. If False, these operations will be done inplace,
933+
potentially scaling. If `False`, these operations will be done inplace,
934934
modifying both arrays.
935935
936936
Attributes
937937
----------
938938
x_weights_ : ndarray of shape (n_features, n_components)
939939
The left singular vectors of the SVD of the cross-covariance matrix.
940-
Used to project `X` in `transform`.
940+
Used to project `X` in :meth:`transform`.
941941
942942
y_weights_ : ndarray of (n_targets, n_components)
943943
The right singular vectors of the SVD of the cross-covariance matrix.
944-
Used to project `X` in `transform`.
944+
Used to project `X` in :meth:`transform`.
945945
946946
x_scores_ : ndarray of shape (n_samples, n_components)
947947
The transformed training samples.
@@ -968,6 +968,11 @@ class PLSSVD(TransformerMixin, BaseEstimator):
968968
969969
.. versionadded:: 1.0
970970
971+
See Also
972+
--------
973+
PLSCanonical : Partial Least Squares transformer and regressor.
974+
CCA : Canonical Correlation Analysis.
975+
971976
Examples
972977
--------
973978
>>> import numpy as np
@@ -984,11 +989,6 @@ class PLSSVD(TransformerMixin, BaseEstimator):
984989
>>> X_c, Y_c = pls.transform(X, Y)
985990
>>> X_c.shape, Y_c.shape
986991
((4, 2), (4, 2))
987-
988-
See Also
989-
--------
990-
PLSCanonical
991-
CCA
992992
"""
993993

994994
def __init__(self, n_components=2, *, scale=True, copy=True):
@@ -1006,6 +1006,11 @@ def fit(self, X, Y):
10061006
10071007
Y : array-like of shape (n_samples,) or (n_samples, n_targets)
10081008
Targets.
1009+
1010+
Returns
1011+
-------
1012+
self : object
1013+
Fitted estimator.
10091014
"""
10101015
check_consistent_length(X, Y)
10111016
X = self._validate_data(
@@ -1118,7 +1123,7 @@ def transform(self, X, Y=None):
11181123
Returns
11191124
-------
11201125
x_scores : array-like or tuple of array-like
1121-
The transformed data `X_tranformed` if `Y` is not None,
1126+
The transformed data `X_tranformed` if `Y is not None`,
11221127
`(X_transformed, Y_transformed)` otherwise.
11231128
"""
11241129
check_is_fitted(self)
@@ -1149,7 +1154,7 @@ def fit_transform(self, X, y=None):
11491154
Returns
11501155
-------
11511156
out : array-like or tuple of array-like
1152-
The transformed data `X_tranformed` if `Y` is not None,
1157+
The transformed data `X_tranformed` if `Y is not None`,
11531158
`(X_transformed, Y_transformed)` otherwise.
11541159
"""
11551160
return self.fit(X, y).transform(X, y)

0 commit comments

Comments
 (0)
0