Skip to content

Commit

Permalink
Added a wrapper for the t-SNE DR method; added an integration test fo…
Browse files Browse the repository at this point in the history
…r it (black-listed for now).
  • Loading branch information
vladislav-horbatiuk committed Apr 29, 2013
1 parent c88afbf commit 5a2df25
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
@@ -0,0 +1,27 @@
#!/usr/bin/env python
from tools.load import LoadMatrix

lm=LoadMatrix()
data = lm.load_numbers('../data/fm_train_real.dat')

parameter_list = [[data]]

def converter_tdistributedstochasticneighborembedding_modular(data):
try:
from shogun.Features import RealFeatures
from shogun.Converter import TDistributedStochasticNeighborEmbedding

features = RealFeatures(data)

converter = TDistributedStochasticNeighborEmbedding()
converter.set_target_dim(2)

embedding = converter.apply(features)

return embedding
except ImportError:
print('No Eigen3 available')

if __name__=='__main__':
print('TDistributedStochasticNeighborEmbedding')
converter_tdistributedstochasticneighborembedding_modular(*parameter_list[0])
2 changes: 2 additions & 0 deletions src/interfaces/modular/Converter.i
Expand Up @@ -22,6 +22,7 @@
%rename(Isomap) CIsomap;
%rename(StochasticProximityEmbedding) CStochasticProximityEmbedding;
%rename(FactorAnalysis) CFactorAnalysis;
%rename (TDistributedStochasticNeighborEmbedding) CTDistributedStochasticNeighborEmbedding;

%newobject shogun::CEmbeddingConverter::apply;
%newobject shogun::*::embed_kernel;
Expand All @@ -42,3 +43,4 @@
%include <shogun/converter/Isomap.h>
%include <shogun/converter/StochasticProximityEmbedding.h>
%include <shogun/converter/FactorAnalysis.h>
%include <shogun/converter/TDistributedStochasticNeighborEmbedding.h>
1 change: 1 addition & 0 deletions src/interfaces/modular/Converter_includes.i
Expand Up @@ -14,4 +14,5 @@
#include <shogun/converter/Isomap.h>
#include <shogun/converter/StochasticProximityEmbedding.h>
#include <shogun/converter/FactorAnalysis.h>
#include <shogun/converter/TDistributedStochasticNeighborEmbedding.h>
%}
1 change: 1 addition & 0 deletions tests/integration/python_modular/generator.py
Expand Up @@ -7,6 +7,7 @@
example_dir = '../../../examples/undocumented/python_modular'
test_dir = '../../../tests/integration/tests'
blacklist = ("__init__.py", "classifier_libsvm_minimal_modular.py",
"converter_tdistributedstochasticneighborembedding_modular.py",
"kernel_combined_modular.py",
"kernel_distance_modular.py",
"distribution_hmm_modular.py",
Expand Down

0 comments on commit 5a2df25

Please sign in to comment.