Examples of IntInstance


Examples of com.clearnlp.classification.instance.IntInstance

     
      vector = toSparseFeatureVector(instance.getFeatureVector());
     
      if (!vector.isEmpty())
      {
        l_instances.add(new IntInstance(label, vector));
        l_indices.add(l_indices.size());
      }
    }
  }
View Full Code Here

Examples of com.clearnlp.classification.instance.IntInstance

   
    int active_size = N, iter, i, s;
    int [] index = UTArray.range(N);
    Random rand = new Random(5);
    List<IntPrediction> ps;
    IntInstance instance;
    IntPrediction max;
    int y;
   
    for (iter=0; iter<MAX_ITER; iter++)
    {
      UTArray.shuffle(rand, index, active_size);
      Gmax_new = Double.NEGATIVE_INFINITY;
      Gmin_new = Double.POSITIVE_INFINITY;
     
      for (s=0; s<active_size; s++)
      {
        i = index[s];
        instance = model.getInstance(i);
        y = instance.getLabel();
       
        ps  = model.getIntPredictions(instance.getFeatureVector());
        max = Collections.max(ps);
       
        G = max.score;
        if (G < 0) G = 0;
        else if (max.label != y) G *= -1d;
View Full Code Here

Examples of com.clearnlp.classification.instance.IntInstance

 
  protected double[] getQD(StringModelAD model)
  {
    int i, size = model.getInstanceSize();
    double[] qd = new double[size];
    IntInstance instance;
   
    for (i=0; i<size; i++)
    {
      instance = model.getInstance(i);
      qd[i] = instance.getFeatureVector().getSumOfSquaredWeights();
    }
   
    return qd;
  }
View Full Code Here

Examples of com.clearnlp.classification.instance.IntInstance

    {
      if ((label = getLabelIndex(instance.getLabel())) < 0)
        continue;
     
      vector = toSparseFeatureVector(instance.getFeatureVector());
      if (!vector.isEmpty()) l_instances.add(new IntInstance(label, vector));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.