Ejemplo n.º 1
0
 public OneClassQ(SvmProblem prob, SvmParameter param)
     : base(prob.Lenght, prob.X, param)
 {
     _cache = new Cache(prob.Lenght, (long)(param.CacheSize * (1 << 20)));
       _qd = new double[prob.Lenght];
       for (int i = 0; i < prob.Lenght; i++)
     _qd[i] = kernel_function(i, i);
 }
Ejemplo n.º 2
0
        public SvrQ(SvmProblem prob, SvmParameter param)
            : base(prob.Lenght, prob.X, param)
        {
            l = prob.Lenght;
              cache = new Cache(l, (long)(param.CacheSize * (1 << 20)));

              QD = new double[2 * l];
              sign = new sbyte[2 * l];
              index = new int[2 * l];

              for (int k = 0; k < l; k++)
              {
            sign[k] = 1;
            sign[k + l] = -1;
            index[k] = k;
            index[k + l] = k;
            QD[k] = kernel_function(k, k);
            QD[k + l] = QD[k];
              }

              buffer = new double[2][] { new double[2 * l], new double[2 * l] };

              next_buffer = 0;
        }
Ejemplo n.º 3
0
	public ONE_CLASS_Q(svm_problem prob, svm_parameter param):base(prob.l, prob.x, param)
	{
		
		cache = new Cache(prob.l,(long)(param.cache_size*(1<<20)));
		QD = new double[prob.l];
		for(int i=0;i<prob.l;i++)
			QD[i] = kernel_function(i,i);
	}
Ejemplo n.º 4
0
	public SVR_Q(svm_problem prob, svm_parameter param):base(prob.l, prob.x, param)
	{
		l = prob.l;
		cache = new Cache(l,(long)(param.cache_size*(1<<20)));
		QD = new double[2*l];
		sign = new sbyte[2*l];
		index = new int[2*l];
		for(int k=0;k<l;k++)
		{
			sign[k] = 1;
			sign[k+l] = -1;
			index[k] = k;
			index[k+l] = k;
			QD[k] = kernel_function(k,k);
			QD[k+l] = QD[k];
		}
		buffer = new float[2][];
	    buffer[0] = new float[2*l];
        buffer[1] = new float[2*l];
		next_buffer = 0;
	}
Ejemplo n.º 5
0
	public SVC_Q(svm_problem prob, svm_parameter param, sbyte[] y_):base(prob.l, prob.x, param)
	{
		
		y = (sbyte[])y_.Clone();
		cache = new Cache(prob.l,(long)(param.cache_size*(1<<20)));
		QD = new double[prob.l];
		for(int i=0;i<prob.l;i++)
			QD[i] = kernel_function(i,i);
	}