Fork me on GitHub

sklearn.cross_decomposition.PLSSVD

class sklearn.cross_decomposition.PLSSVD(n_components=2, scale=True, copy=True)

Partial Least Square SVD

Simply perform a svd on the crosscovariance matrix: X’Y There are no iterative deflation here.

Parameters :

X : array-like of predictors, shape = [n_samples, p]

Training vector, where n_samples is the number of samples and p is the number of predictors. X will be centered before any analysis.

Y : array-like of response, shape = [n_samples, q]

Training vector, where n_samples is the number of samples and q is the number of response variables. X will be centered before any analysis.

n_components : int, (default 2).

number of components to keep.

scale : boolean, (default True)

whether to scale X and Y.

See also

PLSCanonical, CCA

Attributes

x_weights_ array, [p, n_components] X block weights vectors.
y_weights_ array, [q, n_components] Y block weights vectors.
x_scores_ array, [n_samples, n_components] X scores.
y_scores_ array, [n_samples, n_components] Y scores.

Methods

fit(X, Y)
fit_transform(X[, y]) Learn and apply the dimension reduction on the train data.
get_params([deep]) Get parameters for this estimator.
set_params(**params) Set the parameters of this estimator.
transform(X[, Y]) Apply the dimension reduction learned on the train data.
__init__(n_components=2, scale=True, copy=True)
fit_transform(X, y=None, **fit_params)

Learn and apply the dimension reduction on the train data.

Parameters :

X : array-like of predictors, shape = [n_samples, p]

Training vectors, where n_samples in the number of samples and p is the number of predictors.

Y : array-like of response, shape = [n_samples, q], optional

Training vectors, where n_samples in the number of samples and q is the number of response variables.

Returns :

x_scores if Y is not given, (x_scores, y_scores) otherwise. :

get_params(deep=True)

Get parameters for this estimator.

Parameters :

deep: boolean, optional :

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns :

params : mapping of string to any

Parameter names mapped to their values.

set_params(**params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The former have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Returns :self :
transform(X, Y=None)

Apply the dimension reduction learned on the train data.

Previous
Next