Skip to content

Commit

Permalink
Fixed Classic/Landmark modular examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Aug 14, 2011
1 parent cfe4efb commit 5e6a160
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 181 deletions.
Expand Up @@ -8,7 +8,7 @@ public class preprocessor_classicisomap_modular {

RealFeatures features = new RealFeatures(data);

ClassicIsomap preprocessor = new ClassicIsomap();
Isomap preprocessor = new Isomap();
preprocessor.set_target_dim(1);
preprocessor.apply_to_feature_matrix(features);

Expand Down

This file was deleted.

@@ -1,7 +1,7 @@
import org.shogun.*;
import org.jblas.*;

public class preprocessor_classicisomap_modular {
public class preprocessor_isomap_modular {
static {
System.loadLibrary("modshogun");
}
Expand All @@ -12,9 +12,11 @@ public static void main(String argv[]) {
DoubleMatrix data = Load.load_numbers("../data/fm_train_real.dat");

RealFeatures features = new RealFeatures(data);
ClassicIsomap classic = new ClassicIsomap();
classic.set_target_dim(1);
classic.apply_to_feature_matrix(features);
Isomap isomap = new Isomap();
isomap.set_target_dim(1);
isomap.set_k(6);
isomap.set_landmark(false);
isomap.apply_to_feature_matrix(features);

modshogun.exit_shogun();
}
Expand Down

This file was deleted.

@@ -1,7 +1,7 @@
import org.shogun.*;
import org.jblas.*;

public class preprocessor_landmarkisomap_modular {
public class preprocessor_multidimensionalscaling_modular {
static {
System.loadLibrary("modshogun");
}
Expand All @@ -12,9 +12,11 @@ public static void main(String argv[]) {
DoubleMatrix data = Load.load_numbers("../data/fm_train_real.dat");

RealFeatures features = new RealFeatures(data);
LandmarkIsomap landmark = new LandmarkIsomap();
landmark.set_target_dim(1);
landmark.apply_to_feature_matrix(features);
MultidimensionalScaling mds = new MultidimensionalScaling();
mds.set_target_dim(1);
mds.set_landmark(false);

mds.apply_to_feature_matrix(features);

modshogun.exit_shogun();
}
Expand Down
Expand Up @@ -5,18 +5,18 @@ data = load_numbers('../data/fm_train_real.dat')

parameter_list = {{data}}

function preprocessor_classicisomap_modular(data)
function preprocessor_isomap_modular(data)
features = RealFeatures(data)

preprocessor = ClassicIsomap()
preprocessor = Isomap()
preprocessor:set_target_dim(1)
preprocessor:apply_to_feature_matrix(features)

return features
end

if debug.getinfo(3) == nill then
print 'ClassicIsomap'
preprocessor_classicisomap_modular(unpack(parameter_list[1]))
print 'Isomap'
preprocessor_isomap_modular(unpack(parameter_list[1]))
end

This file was deleted.

Expand Up @@ -5,20 +5,23 @@

parameter_list = [[data]]

def preprocessor_landmarkisomap_modular(data):
def preprocessor_isomap_modular(data):
from shogun.Features import RealFeatures
from shogun.Preprocessor import LandmarkIsomap
from shogun.Preprocessor import Isomap

features = RealFeatures(data)

preprocessor = LandmarkIsomap()
preprocessor = Isomap()
preprocessor.set_landmark(True)
preprocessor.set_landmark_number(5)
preprocessor.set_k(6)
preprocessor.set_target_dim(1)
preprocessor.apply_to_feature_matrix(features)

return features


if __name__=='__main__':
print 'LandmarkIsomap'
preprocessor_landmarkisomap_modular(*parameter_list[0])
print 'Isomap'
preprocessor_isomap_modular(*parameter_list[0])

This file was deleted.

Expand Up @@ -5,20 +5,20 @@

parameter_list = [[data]]

def preprocessor_classicisomap_modular(data):
def preprocessor_multidimensionalscaling_modular(data):
from shogun.Features import RealFeatures
from shogun.Preprocessor import ClassicIsomap
from shogun.Preprocessor import MultidimensionalScaling

features = RealFeatures(data)

preprocessor = ClassicIsomap()
preprocessor = MultidimensionalScaling()
preprocessor.set_target_dim(1)
preprocessor.set_landmark(False)
preprocessor.apply_to_feature_matrix(features)

return features


if __name__=='__main__':
print 'ClassicIsomap'
preprocessor_classicisomap_modular(*parameter_list[0])

print 'MultidimensionalScaling'
preprocessor_multidimensionalscaling_modular(*parameter_list[0])
Expand Up @@ -8,11 +8,11 @@

parameter_list = [[data]]

def preprocessor_classicmds_modular(data)
def preprocessor_isomap_modular(data)

features = RealFeatures(data)

preprocessor = ClassicMDS()
preprocessor = Isomap()
preprocessor.set_target_dim(1)
preprocessor.apply_to_feature_matrix(features)

Expand All @@ -22,8 +22,8 @@ def preprocessor_classicmds_modular(data)

end
if __FILE__ == $0
print 'ClassicMDS'
preprocessor_classicmds_modular(*parameter_list[0])
print 'Isomap'
preprocessor_isomap_modular(*parameter_list[0])


end

This file was deleted.

This file was deleted.

Expand Up @@ -8,11 +8,11 @@

parameter_list = [[data]]

def preprocessor_classicisomap_modular(data)
def preprocessor_multidimensionalscaling_modular(data)

features = RealFeatures(data)

preprocessor = ClassicIsomap()
preprocessor = MultidimensionalScaling()
preprocessor.set_target_dim(1)
preprocessor.apply_to_feature_matrix(features)

Expand All @@ -22,8 +22,8 @@ def preprocessor_classicisomap_modular(data)

end
if __FILE__ == $0
print 'ClassicIsomap'
preprocessor_classicisomap_modular(*parameter_list[0])
print 'MultidimensionalScaling'
preprocessor_multidimensionalscaling_modular(*parameter_list[0])


end

0 comments on commit 5e6a160

Please sign in to comment.