@@ -910,10 +910,10 @@ def __init__(
910
910
class PLSSVD (TransformerMixin , BaseEstimator ):
911
911
"""Partial Least Square SVD.
912
912
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.
917
917
918
918
Read more in the :ref:`User Guide <cross_decomposition>`.
919
919
@@ -930,18 +930,18 @@ class PLSSVD(TransformerMixin, BaseEstimator):
930
930
931
931
copy : bool, default=True
932
932
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,
934
934
modifying both arrays.
935
935
936
936
Attributes
937
937
----------
938
938
x_weights_ : ndarray of shape (n_features, n_components)
939
939
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`.
941
941
942
942
y_weights_ : ndarray of (n_targets, n_components)
943
943
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`.
945
945
946
946
x_scores_ : ndarray of shape (n_samples, n_components)
947
947
The transformed training samples.
@@ -968,6 +968,11 @@ class PLSSVD(TransformerMixin, BaseEstimator):
968
968
969
969
.. versionadded:: 1.0
970
970
971
+ See Also
972
+ --------
973
+ PLSCanonical : Partial Least Squares transformer and regressor.
974
+ CCA : Canonical Correlation Analysis.
975
+
971
976
Examples
972
977
--------
973
978
>>> import numpy as np
@@ -984,11 +989,6 @@ class PLSSVD(TransformerMixin, BaseEstimator):
984
989
>>> X_c, Y_c = pls.transform(X, Y)
985
990
>>> X_c.shape, Y_c.shape
986
991
((4, 2), (4, 2))
987
-
988
- See Also
989
- --------
990
- PLSCanonical
991
- CCA
992
992
"""
993
993
994
994
def __init__ (self , n_components = 2 , * , scale = True , copy = True ):
@@ -1006,6 +1006,11 @@ def fit(self, X, Y):
1006
1006
1007
1007
Y : array-like of shape (n_samples,) or (n_samples, n_targets)
1008
1008
Targets.
1009
+
1010
+ Returns
1011
+ -------
1012
+ self : object
1013
+ Fitted estimator.
1009
1014
"""
1010
1015
check_consistent_length (X , Y )
1011
1016
X = self ._validate_data (
@@ -1118,7 +1123,7 @@ def transform(self, X, Y=None):
1118
1123
Returns
1119
1124
-------
1120
1125
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` ,
1122
1127
`(X_transformed, Y_transformed)` otherwise.
1123
1128
"""
1124
1129
check_is_fitted (self )
@@ -1149,7 +1154,7 @@ def fit_transform(self, X, y=None):
1149
1154
Returns
1150
1155
-------
1151
1156
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` ,
1153
1158
`(X_transformed, Y_transformed)` otherwise.
1154
1159
"""
1155
1160
return self .fit (X , y ).transform (X , y )
0 commit comments