示例#1
0
    public static void Main()
    {
        modshogun.init_shogun_with_defaults();
        double width = 1.6;

        double[,] train_real = Load.load_numbers("../data/fm_train_real.dat");
        double[] trainlab = Load.load_labels("../data/label_train_twoclass.dat");

        RealFeatures   feats_train = new RealFeatures(train_real);
        GaussianKernel subkernel   = new GaussianKernel(feats_train, feats_train, width);

        BinaryLabels labels = new BinaryLabels(trainlab);

        AUCKernel kernel = new AUCKernel(0, subkernel);

        kernel.setup_auc_maximization(labels);

        double[,] km_train = kernel.get_kernel_matrix();

        int numRows = km_train.GetLength(0);
        int numCols = km_train.GetLength(1);

        Console.Write("km_train:\n");

        for (int i = 0; i < numRows; i++)
        {
            for (int j = 0; j < numCols; j++)
            {
                Console.Write(km_train[i, j] + " ");
            }
            Console.Write("\n");
        }
    }
示例#2
0
	public static void Main() {
		modshogun.init_shogun_with_defaults();
		double width = 1.6;

		double[,] train_real = Load.load_numbers("../data/fm_train_real.dat");
		double[] trainlab = Load.load_labels("../data/label_train_twoclass.dat");

		RealFeatures feats_train = new RealFeatures(train_real);
		GaussianKernel subkernel = new GaussianKernel(feats_train, feats_train, width);

		Labels labels = new Labels(trainlab);

		AUCKernel kernel = new AUCKernel(0, subkernel);
		kernel.setup_auc_maximization(labels);

		double[,] km_train = kernel.get_kernel_matrix();
		
		int numRows = km_train.GetLength(0);
		int numCols = km_train.GetLength(1);
		
		Console.Write("km_train:\n");
		
		for(int i = 0; i < numRows; i++){
			for(int j = 0; j < numCols; j++){
				Console.Write(km_train[i,j] +" ");
			}
			Console.Write("\n");
		}
		
		modshogun.exit_shogun();
	}
示例#3
0
    static void Main(string[] argv)
    {
        modshogun.init_shogun_with_defaults();
        double width = 1.6;

        DoubleMatrix train_real = Load.load_numbers("../data/fm_train_real.dat");
        DoubleMatrix trainlab = Load.load_labels("../data/label_train_twoclass.dat");

        RealFeatures feats_train = new RealFeatures(train_real);
        GaussianKernel subkernel = new GaussianKernel(feats_train, feats_train, width);

        Labels labels = new Labels(trainlab);

        AUCKernel kernel = new AUCKernel(0, subkernel);
        kernel.setup_auc_maximization(labels);

        DoubleMatrix km_train = kernel.get_kernel_matrix();
        Console.WriteLine(km_train.ToString());

        modshogun.exit_shogun();
    }
示例#4
0
 internal static HandleRef getCPtr(AUCKernel obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
示例#5
0
 internal static HandleRef getCPtr(AUCKernel obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }