Example #1
0
    public virtual object run(IList para)
    {
        modshogun.init_shogun_with_defaults();
        int cardinality = (int)((int?)para[0]);
        int size_cache = (int)((int?)para[1]);

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

        RealFeatures feats_train = new RealFeatures(traindata_real);
        RealFeatures feats_test = new RealFeatures(testdata_real);

        ANOVAKernel kernel = new ANOVAKernel(feats_train, feats_train, cardinality, size_cache);

        DoubleMatrix km_train = kernel.get_kernel_matrix();
        kernel.init(feats_train, feats_test);
        DoubleMatrix km_test = kernel.get_kernel_matrix();

        ArrayList result = new ArrayList();
        result.Add(km_train);
        result.Add(km_test);
        result.Add(kernel);

        modshogun.exit_shogun();
        return (object)result;
    }
    public static void Main()
    {
        modshogun.init_shogun_with_defaults();
        int cardinality = 2;
        int size_cache = 5;

        double[,] traindata_real = Load.load_numbers("../data/fm_train_real.dat");
        double[,] testdata_real = Load.load_numbers("../data/fm_test_real.dat");

        RealFeatures feats_train = new RealFeatures(traindata_real);
        RealFeatures feats_test = new RealFeatures(testdata_real);

        ANOVAKernel kernel = new ANOVAKernel(feats_train, feats_train, cardinality, size_cache);

        double[,] km_train = kernel.get_kernel_matrix();
        kernel.init(feats_train, feats_test);
        double[,] km_test = kernel.get_kernel_matrix();
    }
Example #3
0
 internal static HandleRef getCPtr(ANOVAKernel obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }