import org.shogun.*;
import org.jblas.*;
public class classifier_knn_modular {
	static {
		System.loadLibrary("Features");
		System.loadLibrary("Classifier");
		System.loadLibrary("Kernel");
	}

	public static void main(String argv[]) {
		Features.init_shogun_with_defaults();
		int k = 3;

		DoubleMatrix traindata_real = Load.load_numbers("../../data/toy/fm_train_real.dat");
		DoubleMatrix testdata_real = Load.load_numbers("../../data/toy/fm_test_real.dat");

		DoubleMatrix trainlab = Load.load_labels("../../data/toy/label_train_multiclass.dat");

		RealFeatures feats_train = new RealFeatures();
		feats_train.set_feature_matrix(traindata_real);
		RealFeatures feats_test = new RealFeatures();
		feats_test.set_feature_matrix(testdata_real);
		EuclidianDistance distance = new EuclidianDistance(feats_train, feats_train);

		Labels labels = new Labels(trainlab);

		KNN knn = new KNN(k, distance, labels);
		knn.train();
		DoubleMatrix out_labels = knn.apply(feats_test).get_labels();

		Features.exit_shogun();
	}
}

@@ -178,14 +178,16 @@
 ry(%22
-Kernel
+Distance
 %22);%0A
@@ -336,36 +336,29 @@
 numbers(%22../
-../
 data/
-toy/
 fm_train_rea
@@ -419,28 +419,21 @@
 ers(%22../
-../
 data/
-toy/
 fm_test_
@@ -496,20 +496,13 @@
 %22../
-../
 data/
-toy/
 labe
@@ -578,44 +578,8 @@
 res(
-);%0A%09%09feats_train.set_feature_matrix(
 trai
@@ -640,43 +640,8 @@
 res(
-);%0A%09%09feats_test.set_feature_matrix(
 test
@@ -894,16 +894,61 @@
 abels();
+%0A%09%09System.out.println(out_labels.toString());
 %0A%0A%09%09Feat

make path relative to the java_modular examples dir