Partial Least Square SVD.
This transformer simply performs a SVD on the cross-covariance matrix X'Y. It is able to project both the training data X and the targets Y. The training data X is projected on the left singular vectors, while the targets are projected on the right singular vectors.
Read more in the User Guide.
Added in version 0.8.
The number of components to keep. Should be in [1,
min(n_samples, n_features, n_targets)].
Whether to scale X and Y.
Whether to copy X and Y in fit before applying centering, and potentially scaling. If False, these operations will be done inplace, modifying both arrays.
The left singular vectors of the SVD of the cross-covariance matrix. Used to project X in transform.
The right singular vectors of the SVD of the cross-covariance matrix. Used to project X in transform.
Number of features seen during fit.
n_features_in_,)
Names of features seen during fit. Defined only when X has feature names that are all strings.
Added in version 1.0.
See also
PLSCanonicalPartial Least Squares transformer and regressor.
CCACanonical Correlation Analysis.
>>> import numpy as np >>> from sklearn.cross_decomposition import PLSSVD >>> X = np.array([[0., 0., 1.], ... [1., 0., 0.], ... [2., 2., 2.], ... [2., 5., 4.]]) >>> y = np.array([[0.1, -0.2], ... [0.9, 1.1], ... [6.2, 5.9], ... [11.9, 12.3]]) >>> pls = PLSSVD(n_components=2).fit(X, y) >>> X_c, y_c = pls.transform(X, y) >>> X_c.shape, y_c.shape ((4, 2), (4, 2))
Fit model to data.
Training samples.
Targets.
Targets.
Deprecated since version 1.5: Y is deprecated in 1.5 and will be removed in 1.7. Use y instead.
Fitted estimator.
Learn and apply the dimensionality reduction.
Training samples.
Targets.
The transformed data X_transformed if Y is not None, (X_transformed, Y_transformed) otherwise.
Get output feature names for transformation.
The feature names out will prefixed by the lowercased class name. For example, if the transformer outputs 3 features, then the feature names out are: ["class_name0", "class_name1", "class_name2"].
Only used to validate feature names with the names seen in fit.
Transformed feature names.
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
A MetadataRequest encapsulating routing information.
Get parameters for this estimator.
If True, will return the parameters for this estimator and contained subobjects that are estimators.
Parameter names mapped to their values.
Set output container.
See Introducing the set_output API for an example on how to use the API.
Configure output of transform and fit_transform.
"default": Default output format of a transformer"pandas": DataFrame output"polars": Polars outputNone: Transform configuration is unchangedAdded in version 1.4: "polars" option was added.
Estimator instance.
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.
Estimator parameters.
Estimator instance.
Apply the dimensionality reduction.
Samples to be transformed.
Targets.
Targets.
Deprecated since version 1.5: Y is deprecated in 1.5 and will be removed in 1.7. Use y instead.
The transformed data X_transformed if Y is not None, (X_transformed, Y_transformed) otherwise.
© 2007–2025 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/1.6/modules/generated/sklearn.cross_decomposition.PLSSVD.html