PLSSVD
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.
Python Reference (opens in a new tab)
Constructors
constructor()
Signature
new PLSSVD(opts?: object): PLSSVD;Parameters
| Name | Type | Description |
|---|---|---|
opts? | object | - |
opts.copy? | boolean | 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. Default Value true |
opts.n_components? | number | The number of components to keep. Should be in \[1, min(n\_samples, n\_features, n\_targets)\]. Default Value 2 |
opts.scale? | boolean | Whether to scale X and Y. Default Value true |
Returns
Defined in: generated/cross_decomposition/PLSSVD.ts:25 (opens in a new tab)
Properties
_isDisposed
boolean=false
Defined in: generated/cross_decomposition/PLSSVD.ts:23 (opens in a new tab)
_isInitialized
boolean=false
Defined in: generated/cross_decomposition/PLSSVD.ts:22 (opens in a new tab)
_py
PythonBridge
Defined in: generated/cross_decomposition/PLSSVD.ts:21 (opens in a new tab)
id
string
Defined in: generated/cross_decomposition/PLSSVD.ts:18 (opens in a new tab)
opts
any
Defined in: generated/cross_decomposition/PLSSVD.ts:19 (opens in a new tab)
Accessors
feature_names_in_
Names of features seen during fit. Defined only when X has feature names that are all strings.
Signature
feature_names_in_(): Promise<ArrayLike>;Returns
Promise<ArrayLike>
Defined in: generated/cross_decomposition/PLSSVD.ts:381 (opens in a new tab)
n_features_in_
Number of features seen during fit.
Signature
n_features_in_(): Promise<number>;Returns
Promise<number>
Defined in: generated/cross_decomposition/PLSSVD.ts:358 (opens in a new tab)
py
Signature
py(): PythonBridge;Returns
PythonBridge
Defined in: generated/cross_decomposition/PLSSVD.ts:51 (opens in a new tab)
Signature
py(pythonBridge: PythonBridge): void;Parameters
| Name | Type |
|---|---|
pythonBridge | PythonBridge |
Returns
void
Defined in: generated/cross_decomposition/PLSSVD.ts:55 (opens in a new tab)
x_weights_
The left singular vectors of the SVD of the cross-covariance matrix. Used to project X in transform.
Signature
x_weights_(): Promise<ArrayLike[]>;Returns
Promise<ArrayLike[]>
Defined in: generated/cross_decomposition/PLSSVD.ts:312 (opens in a new tab)
y_weights_
The right singular vectors of the SVD of the cross-covariance matrix. Used to project X in transform.
Signature
y_weights_(): Promise<any>;Returns
Promise<any>
Defined in: generated/cross_decomposition/PLSSVD.ts:335 (opens in a new tab)
Methods
dispose()
Disposes of the underlying Python resources.
Once dispose() is called, the instance is no longer usable.
Signature
dispose(): Promise<void>;Returns
Promise<void>
Defined in: generated/cross_decomposition/PLSSVD.ts:105 (opens in a new tab)
fit()
Fit model to data.
Signature
fit(opts: object): Promise<any>;Parameters
| Name | Type | Description |
|---|---|---|
opts | object | - |
opts.X? | ArrayLike[] | Training samples. |
opts.Y? | ArrayLike | Targets. |
Returns
Promise<any>
Defined in: generated/cross_decomposition/PLSSVD.ts:122 (opens in a new tab)
fit_transform()
Learn and apply the dimensionality reduction.
Signature
fit_transform(opts: object): Promise<ArrayLike>;Parameters
| Name | Type | Description |
|---|---|---|
opts | object | - |
opts.X? | ArrayLike[] | Training samples. |
opts.y? | ArrayLike | Targets. |
Returns
Promise<ArrayLike>
Defined in: generated/cross_decomposition/PLSSVD.ts:162 (opens in a new tab)
get_feature_names_out()
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"\].
Signature
get_feature_names_out(opts: object): Promise<any>;Parameters
| Name | Type | Description |
|---|---|---|
opts | object | - |
opts.input_features? | any | Only used to validate feature names with the names seen in fit. |
Returns
Promise<any>
Defined in: generated/cross_decomposition/PLSSVD.ts:204 (opens in a new tab)
init()
Initializes the underlying Python resources.
This instance is not usable until the Promise returned by init() resolves.
Signature
init(py: PythonBridge): Promise<void>;Parameters
| Name | Type |
|---|---|
py | PythonBridge |
Returns
Promise<void>
Defined in: generated/cross_decomposition/PLSSVD.ts:64 (opens in a new tab)
set_output()
Set output container.
See Introducing the set_output API for an example on how to use the API.
Signature
set_output(opts: object): Promise<any>;Parameters
| Name | Type | Description |
|---|---|---|
opts | object | - |
opts.transform? | "default" | "pandas" | Configure output of transform and fit\_transform. |
Returns
Promise<any>
Defined in: generated/cross_decomposition/PLSSVD.ts:239 (opens in a new tab)
transform()
Apply the dimensionality reduction.
Signature
transform(opts: object): Promise<ArrayLike>;Parameters
| Name | Type | Description |
|---|---|---|
opts | object | - |
opts.X? | ArrayLike[] | Samples to be transformed. |
opts.Y? | ArrayLike | Targets. |
Returns
Promise<ArrayLike>
Defined in: generated/cross_decomposition/PLSSVD.ts:272 (opens in a new tab)