@@ -0,0 +1,1514 @@
+import org.shogun.*;%0Aimport org.jblas.*;%0Apublic class ClassifierLibsvmMinimalModular %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%09%0A%09public static void main(String argv%5B%5D) %7B%0A%09%09Features.init_shogun();%0A%09%09int num = 1000;%0A%09%09int dist = 1;%0A%09%09double width = 2.1;%0A%09%09int C = 1;%0A%0A%09%09DoubleMatrix x = DoubleMatrix.randn(2, num).sub(DoubleMatrix.ones(2, num));%0A%09%09DoubleMatrix y = DoubleMatrix.randn(2, num).add(DoubleMatrix.ones(2, num));%0A%09%09DoubleMatrix traindata_real = DoubleMatrix.concatHorizontally(x, y);%0A%0A%09%09DoubleMatrix m = DoubleMatrix.randn(2, num).sub(DoubleMatrix.ones(2, num));%0A%09%09DoubleMatrix n = DoubleMatrix.randn(2, num).add(DoubleMatrix.ones(2, num));%0A%09%09DoubleMatrix testdata_real = DoubleMatrix.concatHorizontally(m, n);%0A%0A%09%09DoubleMatrix trainlab = DoubleMatrix.concatHorizontally(DoubleMatrix.ones(num).neg(), DoubleMatrix.ones(num));%0A%09%09DoubleMatrix testlab = DoubleMatrix.concatHorizontally(DoubleMatrix.ones(num).neg(), DoubleMatrix.ones(num));%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%09GaussianKernel kernel = new GaussianKernel(feats_train, feats_train, width);%0A%0A%09%09Labels labels = new Labels(trainlab);%0A%09%09LibSVM svm = new LibSVM(C, kernel, labels);%0A%09%09svm.train();%0A%0A%09%09kernel.init(feats_train, feats_test);%0A%09%09double%5B%5D out = svm.apply().get_labels();%0A%09%09Features.exit_shogun();%0A%09%7D%0A%7D%0A

add ClassifierLibsvmMinimalModular exmaple