Class: FastICA
FastICA: a fast algorithm for Independent Component Analysis.
The implementation is based on [1].
Read more in the User Guide.
Constructors
new FastICA()
new FastICA(
opts
?):FastICA
Parameters
Parameter | Type | Description |
---|---|---|
opts ? | object | - |
opts.algorithm ? | "parallel" | "deflation" | Specify which algorithm to use for FastICA. |
opts.fun ? | "logcosh" | "exp" | "cube" | The functional form of the G function used in the approximation to neg-entropy. Could be either ‘logcosh’, ‘exp’, or ‘cube’. You can also provide your own function. It should return a tuple containing the value of the function, and of its derivative, in the point. The derivative should be averaged along its last dimension. Example: |
opts.fun_args ? | any | Arguments to send to the functional form. If empty or undefined and if fun=’logcosh’, fun_args will take value {‘alpha’ : 1.0}. |
opts.max_iter ? | number | Maximum number of iterations during fit. |
opts.n_components ? | number | Number of components to use. If undefined is passed, all are used. |
opts.random_state ? | number | Used to initialize w_init when not specified, with a normal distribution. Pass an int, for reproducible results across multiple function calls. See Glossary. |
opts.tol ? | number | A positive scalar giving the tolerance at which the un-mixing matrix is considered to have converged. |
opts.w_init ? | ArrayLike [] | Initial un-mixing array. If w_init=None , then an array of values drawn from a normal distribution is used. |
opts.whiten ? | string | boolean | Specify the whitening strategy to use. |
opts.whiten_solver ? | "svd" | "eigh" | The solver to use for whitening. |
Returns FastICA
Defined in generated/decomposition/FastICA.ts:25
Properties
Property | Type | Default value | Defined in |
---|---|---|---|
_isDisposed | boolean | false | generated/decomposition/FastICA.ts:23 |
_isInitialized | boolean | false | generated/decomposition/FastICA.ts:22 |
_py | PythonBridge | undefined | generated/decomposition/FastICA.ts:21 |
id | string | undefined | generated/decomposition/FastICA.ts:18 |
opts | any | undefined | generated/decomposition/FastICA.ts:19 |
Accessors
components_
Get Signature
get components_():
Promise
<ArrayLike
[]>
The linear operator to apply to the data to get the independent sources. This is equal to the unmixing matrix when whiten
is false
, and equal to np.dot(unmixing_matrix, self.whitening_)
when whiten
is true
.
Returns Promise
<ArrayLike
[]>
Defined in generated/decomposition/FastICA.ts:488
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/decomposition/FastICA.ts:581
mean_
Get Signature
get mean_():
Promise
<any
>
The mean over features. Only set if self.whiten
is true
.
Returns Promise
<any
>
Defined in generated/decomposition/FastICA.ts:534
mixing_
Get Signature
get mixing_():
Promise
<ArrayLike
[]>
The pseudo-inverse of components_
. It is the linear operator that maps independent sources to the data.
Returns Promise
<ArrayLike
[]>
Defined in generated/decomposition/FastICA.ts:511
n_features_in_
Get Signature
get n_features_in_():
Promise
<number
>
Number of features seen during fit.
Returns Promise
<number
>
Defined in generated/decomposition/FastICA.ts:556
n_iter_
Get Signature
get n_iter_():
Promise
<number
>
If the algorithm is “deflation”, n_iter is the maximum number of iterations run across all components. Else they are just the number of iterations taken to converge.
Returns Promise
<number
>
Defined in generated/decomposition/FastICA.ts:606
py
Get Signature
get py():
PythonBridge
Returns PythonBridge
Set Signature
set py(
pythonBridge
):void
Parameters
Parameter | Type |
---|---|
pythonBridge | PythonBridge |
Returns void
Defined in generated/decomposition/FastICA.ts:92
whitening_
Get Signature
get whitening_():
Promise
<ArrayLike
[]>
Only set if whiten is ‘true
’. This is the pre-whitening matrix that projects data onto the first n_components
principal components.
Returns Promise
<ArrayLike
[]>
Defined in generated/decomposition/FastICA.ts:629
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/decomposition/FastICA.ts:143
fit()
fit(
opts
):Promise
<any
>
Fit the model to X.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | ArrayLike [] | Training data, where n_samples is the number of samples and n_features is the number of features. |
opts.y ? | any | Not used, present for API consistency by convention. |
Returns Promise
<any
>
Defined in generated/decomposition/FastICA.ts:160
fit_transform()
fit_transform(
opts
):Promise
<ArrayLike
[]>
Fit the model and recover the sources from X.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | ArrayLike [] | Training data, where n_samples is the number of samples and n_features is the number of features. |
opts.y ? | any | Not used, present for API consistency by convention. |
Returns Promise
<ArrayLike
[]>
Defined in generated/decomposition/FastICA.ts:197
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/decomposition/FastICA.ts:236
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/decomposition/FastICA.ts:270
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/decomposition/FastICA.ts:105
inverse_transform()
inverse_transform(
opts
):Promise
<ArrayLike
[]>
Transform the sources back to the mixed data (apply mixing matrix).
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.copy ? | boolean | If false , data passed to fit are overwritten. Defaults to true . |
opts.X ? | ArrayLike [] | Sources, where n_samples is the number of samples and n_components is the number of components. |
Returns Promise
<ArrayLike
[]>
Defined in generated/decomposition/FastICA.ts:302
set_inverse_transform_request()
set_inverse_transform_request(
opts
):Promise
<any
>
Request metadata passed to the inverse_transform
method.
Note that this method is only relevant if enable_metadata_routing=True
(see sklearn.set_config
). Please see User Guide on how the routing mechanism works.
The options for each parameter are:
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.copy ? | string | boolean | Metadata routing for copy parameter in inverse_transform . |
Returns Promise
<any
>
Defined in generated/decomposition/FastICA.ts:345
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/decomposition/FastICA.ts:381
set_transform_request()
set_transform_request(
opts
):Promise
<any
>
Request metadata passed to the transform
method.
Note that this method is only relevant if enable_metadata_routing=True
(see sklearn.set_config
). Please see User Guide on how the routing mechanism works.
The options for each parameter are:
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.copy ? | string | boolean | Metadata routing for copy parameter in transform . |
Returns Promise
<any
>
Defined in generated/decomposition/FastICA.ts:417
transform()
transform(
opts
):Promise
<ArrayLike
[]>
Recover the sources from X (apply the unmixing matrix).
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.copy ? | boolean | If false , data passed to fit can be overwritten. Defaults to true . |
opts.X ? | ArrayLike [] | Data to transform, where n_samples is the number of samples and n_features is the number of features. |
Returns Promise
<ArrayLike
[]>
Defined in generated/decomposition/FastICA.ts:449