Documentation
Classes
FastICA

FastICA

FastICA: a fast algorithm for Independent Component Analysis.

The implementation is based on [1].

Read more in the User Guide.

Python Reference (opens in a new tab)

Constructors

constructor()

Signature

new FastICA(opts?: object): FastICA;

Parameters

NameTypeDescription
opts?object-
opts.algorithm?"parallel" | "deflation"Specify which algorithm to use for FastICA. Default Value 'parallel'
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: Default Value 'logcosh'
opts.fun_args?anyArguments 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?numberMaximum number of iterations during fit. Default Value 200
opts.n_components?numberNumber of components to use. If undefined is passed, all are used.
opts.random_state?numberUsed 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?numberA positive scalar giving the tolerance at which the un-mixing matrix is considered to have converged. Default Value 0.0001
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 | booleanSpecify the whitening strategy to use. Default Value 'unit-variance'
opts.whiten_solver?"svd" | "eigh"The solver to use for whitening. Default Value 'svd'

Returns

FastICA

Defined in: generated/decomposition/FastICA.ts:25 (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/decomposition/FastICA.ts:154 (opens in a new tab)

fit()

Fit the model to X.

Signature

fit(opts: object): Promise<any>;

Parameters

NameTypeDescription
optsobject-
opts.X?ArrayLike[]Training data, where n\_samples is the number of samples and n\_features is the number of features.
opts.y?anyNot used, present for API consistency by convention.

Returns

Promise<any>

Defined in: generated/decomposition/FastICA.ts:171 (opens in a new tab)

fit_transform()

Fit the model and recover the sources from X.

Signature

fit_transform(opts: object): Promise<ArrayLike[]>;

Parameters

NameTypeDescription
optsobject-
opts.X?ArrayLike[]Training data, where n\_samples is the number of samples and n\_features is the number of features.
opts.y?anyNot used, present for API consistency by convention.

Returns

Promise<ArrayLike[]>

Defined in: generated/decomposition/FastICA.ts:209 (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

NameTypeDescription
optsobject-
opts.input_features?anyOnly used to validate feature names with the names seen in fit.

Returns

Promise<any>

Defined in: generated/decomposition/FastICA.ts:249 (opens in a new tab)

get_metadata_routing()

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Signature

get_metadata_routing(opts: object): Promise<any>;

Parameters

NameTypeDescription
optsobject-
opts.routing?anyA MetadataRequest encapsulating routing information.

Returns

Promise<any>

Defined in: generated/decomposition/FastICA.ts:284 (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

NameType
pyPythonBridge

Returns

Promise<void>

Defined in: generated/decomposition/FastICA.ts:105 (opens in a new tab)

inverse_transform()

Transform the sources back to the mixed data (apply mixing matrix).

Signature

inverse_transform(opts: object): Promise<ArrayLike[]>;

Parameters

NameTypeDescription
optsobject-
opts.X?ArrayLike[]Sources, where n\_samples is the number of samples and n\_components is the number of components.
opts.copy?booleanIf false, data passed to fit are overwritten. Defaults to true. Default Value true

Returns

Promise<ArrayLike[]>

Defined in: generated/decomposition/FastICA.ts:317 (opens in a new tab)

set_inverse_transform_request()

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:

Signature

set_inverse_transform_request(opts: object): Promise<any>;

Parameters

NameTypeDescription
optsobject-
opts.copy?string | booleanMetadata routing for copy parameter in inverse\_transform.

Returns

Promise<any>

Defined in: generated/decomposition/FastICA.ts:363 (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

NameTypeDescription
optsobject-
opts.transform?"default" | "pandas"Configure output of transform and fit\_transform.

Returns

Promise<any>

Defined in: generated/decomposition/FastICA.ts:400 (opens in a new tab)

set_transform_request()

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:

Signature

set_transform_request(opts: object): Promise<any>;

Parameters

NameTypeDescription
optsobject-
opts.copy?string | booleanMetadata routing for copy parameter in transform.

Returns

Promise<any>

Defined in: generated/decomposition/FastICA.ts:437 (opens in a new tab)

transform()

Recover the sources from X (apply the unmixing matrix).

Signature

transform(opts: object): Promise<ArrayLike[]>;

Parameters

NameTypeDescription
optsobject-
opts.X?ArrayLike[]Data to transform, where n\_samples is the number of samples and n\_features is the number of features.
opts.copy?booleanIf false, data passed to fit can be overwritten. Defaults to true. Default Value true

Returns

Promise<ArrayLike[]>

Defined in: generated/decomposition/FastICA.ts:470 (opens in a new tab)

Properties

_isDisposed

boolean = false

Defined in: generated/decomposition/FastICA.ts:23 (opens in a new tab)

_isInitialized

boolean = false

Defined in: generated/decomposition/FastICA.ts:22 (opens in a new tab)

_py

PythonBridge

Defined in: generated/decomposition/FastICA.ts:21 (opens in a new tab)

id

string

Defined in: generated/decomposition/FastICA.ts:18 (opens in a new tab)

opts

any

Defined in: generated/decomposition/FastICA.ts:19 (opens in a new tab)

Accessors

components_

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.

Signature

components_(): Promise<ArrayLike[]>;

Returns

Promise<ArrayLike[]>

Defined in: generated/decomposition/FastICA.ts:512 (opens in a new tab)

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/decomposition/FastICA.ts:605 (opens in a new tab)

mean_

The mean over features. Only set if self.whiten is true.

Signature

mean_(): Promise<any>;

Returns

Promise<any>

Defined in: generated/decomposition/FastICA.ts:558 (opens in a new tab)

mixing_

The pseudo-inverse of components\_. It is the linear operator that maps independent sources to the data.

Signature

mixing_(): Promise<ArrayLike[]>;

Returns

Promise<ArrayLike[]>

Defined in: generated/decomposition/FastICA.ts:535 (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/decomposition/FastICA.ts:580 (opens in a new tab)

n_iter_

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.

Signature

n_iter_(): Promise<number>;

Returns

Promise<number>

Defined in: generated/decomposition/FastICA.ts:630 (opens in a new tab)

py

Signature

py(): PythonBridge;

Returns

PythonBridge

Defined in: generated/decomposition/FastICA.ts:92 (opens in a new tab)

Signature

py(pythonBridge: PythonBridge): void;

Parameters

NameType
pythonBridgePythonBridge

Returns

void

Defined in: generated/decomposition/FastICA.ts:96 (opens in a new tab)

whitening_

Only set if whiten is ‘true’. This is the pre-whitening matrix that projects data onto the first n\_components principal components.

Signature

whitening_(): Promise<ArrayLike[]>;

Returns

Promise<ArrayLike[]>

Defined in: generated/decomposition/FastICA.ts:653 (opens in a new tab)