t-SNE

In the Shogun library, the t-SNE algorithm is implemented in the CTDistributedStochasticNeighborEmbedding class. Objects of this class should be configured with the target number of dimensions and the set_target_dim() method. The fit() and transform() methods should be used for training and data dimensionality reduction, respectively:

 void TSNEReduction(Some<CDenseFeatures<DataType>> features,
const int target_dim) {
auto tsne = some<CTDistributedStochasticNeighborEmbedding>();
tsne->set_target_dim(target_dim);
tsne->fit(features);

auto new_features =
static_cast<CDenseFeatures<DataType> *>(tsne->transform(features));

auto feature_matrix = new_features->get_feature_matrix();
for (index_t i = 0; i < new_features->get_num_vectors(); ++i) {
auto new_vector = feature_matrix.get_column(i);
}
}

The following graph shows the result of applying the Shogun t-SNE implementation to our data:

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

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