ICA

In the Shogun library, the ICA algorithm is implemented in the CFast ICA class. There is no particular configuration for the object of this class. The fit() and transform() methods should be used for training and data dimensionality reduction, respectively. After we've transformed the data, we can use some components as new features.

We can also use a reduced number of features to make low-dimensional data:

 void ICAReduction(Some<CDenseFeatures<DataType>> features,
const int target_dim) {
auto ica = some<CFast ICA>();
ica->fit(features);

auto new_features =
static_cast<CDenseFeatures<DataType> *>(ica->transform(features));
auto casted =
CDenseFeatures<float64_t>::obtain_from_generic(new_features);

Clusters clusters;
auto unmixed_signal = casted->get_feature_matrix();
for (index_t i = 0; i < new_features->get_num_vectors(); ++i) {
auto new_vector = unmixed_signal.get_column(i);
// choose 1 and 2 as our main components
new_vector[1];
new_vector[2];
}
}

The following graph shows the result of applying the Shogun ICA implementation to our data. In this example, we've only used two components for the visualization:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.30.236