Examples of IntPrediction


Examples of com.clearnlp.classification.prediction.IntPrediction

    List<IntPrediction> list = Lists.newArrayList();
    double[] scores = getScores(x);
    int i;
   
    for (i=0; i<n_labels; i++)
      list.add(new IntPrediction(i, scores[i]));
   
    return list;
  }
View Full Code Here

Examples of com.clearnlp.classification.prediction.IntPrediction

    super(alpha, rho, eps);
  }
 
  protected boolean update(int L, int y, int[] x, double[] v, double[] gs, double[] weights)
  {
    IntPrediction max = getPrediction(L, y, x, v, weights);
   
    if (max.label != y)
    {
      updateCounts (L, gs, y, max.label, x, v);
      updateWeights(L, gs, y, max.label, x, v, weights);
View Full Code Here

Examples of com.clearnlp.classification.prediction.IntPrediction

    return false;
  }
 
  protected boolean update(int L, int y, int[] x, double[] v, double[] gs, double[] cWeights, double[] aWeights, int count)
  {
    IntPrediction max = getPrediction(L, y, x, v, cWeights);
   
    if (max.label != y)
    {
      updateCounts (L, gs, y, max.label, x, v);
      updateWeights(L, gs, y, max.label, x, v, cWeights, aWeights, count);
View Full Code Here

Examples of com.clearnlp.classification.prediction.IntPrediction

  private IntPrediction getPrediction(int L, int y, int[] x, double[] v, double[] weights)
  {
    double[] scores = getScores(L, x, v, weights);
    scores[y] -= 1;
   
    IntPrediction max = new IntPrediction(0, scores[0]);
    int label;
   
    for (label=1; label<L; label++)
    {
      if (max.score < scores[label])
        max.set(label, scores[label]);
    }
 
    return max;
  }
View Full Code Here

Examples of com.clearnlp.classification.prediction.IntPrediction

    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);
View Full Code Here

Examples of com.clearnlp.classification.prediction.IntPrediction

  }
 
  @Override
  protected boolean update(StringModelAD model, IntInstance instance, int averageCount)
  {
    IntPrediction max = getPrediction(model, instance);
   
    if (max.label != instance.getLabel())
    {
      updateCounts (model, instance, instance.getLabel(), max.label);
      updateWeights(model, instance, instance.getLabel(), max.label, averageCount);
View Full Code Here

Examples of com.clearnlp.classification.prediction.IntPrediction

    super(alpha, rho, eps);
  }
 
  protected boolean update(int L, int y, int[] x, double[] v, double[] gs, double[] weights)
  {
    IntPrediction max = getPrediction(L, y, x, v, weights);
   
    if (max.label != y)
    {
      updateCounts (L, gs, y, max.label, x, v);
      updateWeights(L, gs, y, max.label, x, v, weights);
View Full Code Here

Examples of com.clearnlp.classification.prediction.IntPrediction

  protected IntPrediction getPrediction(int L, int y, int[] x, double[] v, double[] weights)
  {
    double[] scores = getScores(L, x, v, weights);
    scores[y] -= 1;
   
    IntPrediction max = new IntPrediction(0, scores[0]);
    int label;
   
    for (label=1; label<L; label++)
    {
      if (max.score < scores[label])
        max.set(label, scores[label]);
    }
 
    return max;
  }
View Full Code Here

Examples of com.clearnlp.classification.prediction.IntPrediction

  }
 
  @Override
  protected boolean update(StringOnlineModel model, IntInstance instance, double[] gs)
  {
    IntPrediction max = getPrediction(model, instance, gs);
   
    if (max.label != instance.getLabel())
    {
      updateCounts (model, instance, gs, instance.getLabel(), max.label);
      updateWeights(model, instance, gs, instance.getLabel(), max.label);
View Full Code Here

Examples of com.clearnlp.classification.prediction.IntPrediction

    List<IntPrediction> list = Lists.newArrayList();
    double[] scores = getScores(x);
    int i;
   
    for (i=0; i<n_labels; i++)
      list.add(new IntPrediction(i, scores[i]));
   
    return list;
  }
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.