Independent Component Analysis

Independent component analysis (ICA) separates a multivariate signal into additive subcomponents that are maximally independent. It is typically used for separating superimposed signals.

The ICA algorithm presented here is fastICA, see [HyvarinenO00] for details. There are many other ICA implementations, all based on CICAConverter

Example

Given a dataset which we assume consists of linearly mixed signals, we create CDenseFeatures (RealFeatures, here 64 bit float values).

features = RealFeatures(f_feats)
features = RealFeatures(f_feats);
RealFeatures features = new RealFeatures(f_feats);
features = Shogun::RealFeatures.new f_feats
features <- RealFeatures(f_feats)
features = shogun.RealFeatures(f_feats)
RealFeatures features = new RealFeatures(f_feats);
auto features = some<CDenseFeatures<float64_t>>(f_feats);

We create the CFastICA instance, and set its parameter for the iterative optimization.

ica = FastICA()
ica.set_max_iter(200)
ica.set_tol(0.00001)
ica = FastICA();
ica.set_max_iter(200);
ica.set_tol(0.00001);
FastICA ica = new FastICA();
ica.set_max_iter(200);
ica.set_tol(0.00001);
ica = Shogun::FastICA.new 
ica.set_max_iter 200
ica.set_tol 0.00001
ica <- FastICA()
ica$set_max_iter(200)
ica$set_tol(0.00001)
ica = shogun.FastICA()
ica:set_max_iter(200)
ica:set_tol(0.00001)
FastICA ica = new FastICA();
ica.set_max_iter(200);
ica.set_tol(0.00001);
auto ica = some<CFastICA>();
ica->set_max_iter(200);
ica->set_tol(0.00001);

Then we apply ICA, which gives the unmixed signals.

converted = ica.apply(features)
converted = ica.apply(features);
Features converted = ica.apply(features);
converted = ica.apply features
converted <- ica$apply(features)
converted = ica:apply(features)
Features converted = ica.apply(features);
auto converted = ica->apply(features);

We can also extract the estimated mixing matrix.

mixing_matrix = ica.get_mixing_matrix()
casted = RealFeatures.obtain_from_generic(converted)
unmixed_signal = casted.get_feature_matrix()
mixing_matrix = ica.get_mixing_matrix();
casted = RealFeatures.obtain_from_generic(converted);
unmixed_signal = casted.get_feature_matrix();
DoubleMatrix mixing_matrix = ica.get_mixing_matrix();
RealFeatures casted = RealFeatures.obtain_from_generic(converted);
DoubleMatrix unmixed_signal = casted.get_feature_matrix();
mixing_matrix = ica.get_mixing_matrix 
casted = Shogun::RealFeatures.obtain_from_generic converted
unmixed_signal = casted.get_feature_matrix 
mixing_matrix <- ica$get_mixing_matrix()
casted <- RealFeatures$obtain_from_generic(converted)
unmixed_signal <- casted$get_feature_matrix()
mixing_matrix = ica:get_mixing_matrix()
casted = RealFeatures:obtain_from_generic(converted)
unmixed_signal = casted:get_feature_matrix()
double[,] mixing_matrix = ica.get_mixing_matrix();
RealFeatures casted = RealFeatures.obtain_from_generic(converted);
double[,] unmixed_signal = casted.get_feature_matrix();
auto mixing_matrix = ica->get_mixing_matrix();
auto casted = CDenseFeatures<float64_t>::obtain_from_generic(converted);
auto unmixed_signal = casted->get_feature_matrix();

References

Wikipedia: Independent_component_analysis

[HyvarinenO00]A. Hyvärinen and E. Oja. Independent component analysis: algorithms and applications. Neural networks, 13(4):411–430, 2000.