Class: 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.
Constructors
new PLSSVD()
new PLSSVD(
opts
?):PLSSVD
Parameters
Parameter | 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. |
opts.n_components ? | number | The number of components to keep. Should be in \[1, min(n_samples, n_features, n_targets)\] . |
opts.scale ? | boolean | Whether to scale X and Y . |
Returns PLSSVD
Defined in generated/cross_decomposition/PLSSVD.ts:25
Properties
Property | Type | Default value | Defined in |
---|---|---|---|
_isDisposed | boolean | false | generated/cross_decomposition/PLSSVD.ts:23 |
_isInitialized | boolean | false | generated/cross_decomposition/PLSSVD.ts:22 |
_py | PythonBridge | undefined | generated/cross_decomposition/PLSSVD.ts:21 |
id | string | undefined | generated/cross_decomposition/PLSSVD.ts:18 |
opts | any | undefined | generated/cross_decomposition/PLSSVD.ts:19 |
Accessors
feature_names_in_
Get Signature
get feature_names_in_():
Promise
<ArrayLike
>
Names of features seen during fit. Defined only when X
has feature names that are all strings.
Returns Promise
<ArrayLike
>
Defined in generated/cross_decomposition/PLSSVD.ts:411
n_features_in_
Get Signature
get n_features_in_():
Promise
<number
>
Number of features seen during fit.
Returns Promise
<number
>
Defined in generated/cross_decomposition/PLSSVD.ts:388
py
Get Signature
get py():
PythonBridge
Returns PythonBridge
Set Signature
set py(
pythonBridge
):void
Parameters
Parameter | Type |
---|---|
pythonBridge | PythonBridge |
Returns void
Defined in generated/cross_decomposition/PLSSVD.ts:51
x_weights_
Get Signature
get x_weights_():
Promise
<ArrayLike
[]>
The left singular vectors of the SVD of the cross-covariance matrix. Used to project X
in transform
.
Returns Promise
<ArrayLike
[]>
Defined in generated/cross_decomposition/PLSSVD.ts:342
y_weights_
Get Signature
get y_weights_():
Promise
<any
>
The right singular vectors of the SVD of the cross-covariance matrix. Used to project X
in transform
.
Returns Promise
<any
>
Defined in generated/cross_decomposition/PLSSVD.ts:365
Methods
dispose()
dispose():
Promise
<void
>
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
Returns Promise
<void
>
Defined in generated/cross_decomposition/PLSSVD.ts:102
fit()
fit(
opts
):Promise
<any
>
Fit model to data.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | ArrayLike [] | Training samples. |
opts.y ? | ArrayLike | Targets. |
opts.Y ? | ArrayLike | Targets. |
Returns Promise
<any
>
Defined in generated/cross_decomposition/PLSSVD.ts:119
fit_transform()
fit_transform(
opts
):Promise
<ArrayLike
>
Learn and apply the dimensionality reduction.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | ArrayLike [] | Training samples. |
opts.y ? | ArrayLike | Targets. |
Returns Promise
<ArrayLike
>
Defined in generated/cross_decomposition/PLSSVD.ts:161
get_feature_names_out()
get_feature_names_out(
opts
):Promise
<any
>
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"\]
.
Parameters
Parameter | 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:200
get_metadata_routing()
get_metadata_routing(
opts
):Promise
<any
>
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.routing ? | any | A MetadataRequest encapsulating routing information. |
Returns Promise
<any
>
Defined in generated/cross_decomposition/PLSSVD.ts:234
init()
init(
py
):Promise
<void
>
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
Parameters
Parameter | Type |
---|---|
py | PythonBridge |
Returns Promise
<void
>
Defined in generated/cross_decomposition/PLSSVD.ts:64
set_output()
set_output(
opts
):Promise
<any
>
Set output container.
See Introducing the set_output API for an example on how to use the API.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.transform ? | "default" | "pandas" | "polars" | Configure output of transform and fit_transform . |
Returns Promise
<any
>
Defined in generated/cross_decomposition/PLSSVD.ts:268
transform()
transform(
opts
):Promise
<ArrayLike
>
Apply the dimensionality reduction.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | ArrayLike [] | Samples to be transformed. |
opts.y ? | ArrayLike | Targets. |
opts.Y ? | ArrayLike | Targets. |
Returns Promise
<ArrayLike
>
Defined in generated/cross_decomposition/PLSSVD.ts:300