コード例 #1
0
	public static void Main() {
	
		modshogun.init_shogun_with_defaults();
		
		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);
		
		CanberraMetric distance = new CanberraMetric(feats_train, feats_train);
		
		double[,] dm_train = distance.get_distance_matrix();
		distance.init(feats_train, feats_test);
		double[,] dm_test = distance.get_distance_matrix();
		
		foreach(double item in dm_train) {
			Console.Write(item);
		}
		
		foreach(double item in dm_test) {
			Console.Write(item);
		}

		modshogun.exit_shogun();
	}
コード例 #2
0
    public static void Main()
    {
        modshogun.init_shogun_with_defaults();

        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);

        CanberraMetric distance = new CanberraMetric(feats_train, feats_train);

        double[,] dm_train = distance.get_distance_matrix();
        distance.init(feats_train, feats_test);
        double[,] dm_test = distance.get_distance_matrix();

        foreach (double item in dm_train)
        {
            Console.Write(item);
        }

        foreach (double item in dm_test)
        {
            Console.Write(item);
        }

        modshogun.exit_shogun();
    }
コード例 #3
0
    static void Main(string[] argv)
    {
        modshogun.init_shogun_with_defaults();

        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);

        CanberraMetric distance = new CanberraMetric(feats_train, feats_train);

        DoubleMatrix dm_train = distance.get_distance_matrix();
        distance.init(feats_train, feats_test);
        DoubleMatrix dm_test = distance.get_distance_matrix();

        Console.WriteLine(dm_train.ToString());
        Console.WriteLine(dm_test.ToString());

        modshogun.exit_shogun();
    }
コード例 #4
0
ファイル: CanberraMetric.cs プロジェクト: Anshul-Bansal/gsoc
 internal static HandleRef getCPtr(CanberraMetric obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
コード例 #5
0
 internal static HandleRef getCPtr(CanberraMetric obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }