@@ -0,0 +1,1027 @@
+import org.shogun.*;%0Aimport org.jblas.*;%0Apublic class classifier_knn_modular %7B%0A%09static %7B%0A%09%09System.loadLibrary(%22Features%22);%0A%09%09System.loadLibrary(%22Classifier%22);%0A%09%09System.loadLibrary(%22Kernel%22);%0A%09%7D%0A%0A%09public static void main(String argv%5B%5D) %7B%0A%09%09Features.init_shogun_with_defaults();%0A%09%09double k = 3;%0A%0A%09%09DoubleMatrix traindata_real = Load.load_numbers(%22../../data/toy/fm_train_real.dat%22);%0A%09%09DoubleMatrix testdata_real = Load.load_numbers(%22../../data/toy/fm_test_real.dat%22);%0A%0A%09%09DoubleMatrix trainlab = Load.load_labels(%22../../data/toy/label_train_multiclass.dat%22);%0A%0A%09%09RealFeatures feats_train = new RealFeatures();%0A%09%09feats_train.set_feature_matrix(traindata_real);%0A%09%09RealFeatures feats_test = new RealFeatures();%0A%09%09feats_test.set_feature_matrix(testdata_real);%0A%09%09EuclidianDistance distance = new EuclidianDistance(feats_train, feats_train);%0A%0A%09%09Labels labels = new Labels(trainlab);%0A%0A%09%09KNN knn = new KNN(k, distance, labels);%0A%09%09knn.train();%0A%09%09DoubleMatrix out_labels = knn.apply(feats_test).get_labels();%0A%0A%09%09Features.exit_shogun();%0A%09%7D%0A%7D%0A

add example file classifier_knn_modular.java