Package types

Examples of types.Evaluation


      this.precWeight = precWeight;
    }
  }

  public double calculate(int truth, int guess) {
    Evaluation eval = Evaluate.eval(truth, guess, tagOfInterest);
    // this ensures that we don't make an update if fn = 0.
    if (precWeight == 0 && eval.fn == 0)
      return -1e10;
    return eval.fp * precWeight + eval.fn * recWeight;
  }
 
View Full Code Here


   *            tag wrt which we compute tp,fp,fn
   * @return
   */
  public static Evaluation eval(LinearTagger h,
      ArrayList<SequenceInstance> data, int tagOfInterest) {
    Evaluation eval = new Evaluation(0, 0, 0, 0, 0);
    for (SequenceInstance inst : data) {
      int[] hx = h.label(inst.x);
      updateEvaluation(eval, inst.y, hx, tagOfInterest);
    }
    return eval;
View Full Code Here

   *            tag wrt which we compute tp,fp,fn
   * @return
   */
  public static Evaluation eval(LinearTagger h, SequenceInstance inst,
      int tagOfInterest) {
    Evaluation eval = new Evaluation(0, 0, 0, 0, 0);
    int[] hx = h.label(inst.x);
    updateEvaluation(eval, inst.y, hx, tagOfInterest);
    return eval;
  }
View Full Code Here

    updateEvaluation(eval, inst.y, hx, tagOfInterest);
    return eval;
  }

  public static Evaluation eval(int[] truth, int[] guess, int tagOfInterest) {
    Evaluation eval = new Evaluation(0, 0, 0, 0, 0);
    updateEvaluation(eval, truth, guess, tagOfInterest);
    return eval;
  }
View Full Code Here

      this.precWeight = precWeight;
    }
  }

  public double calculate(int[] truth, int[] guess) {
    Evaluation eval = Evaluate.eval(truth, guess, tagOfInterest);
    // this ensures that we don't make an update if fn = 0.
    if (precWeight == 0 && eval.fn == 0)
      return -1e10;
    return eval.fp * precWeight + eval.fn * recWeight;
  }
 
View Full Code Here

   *            tag wrt which we compute tp,fp,fn
   * @return
   */
  public static Evaluation eval(LinearClassifier h,
      ArrayList<ClassificationInstance> data, int tagOfInterest) {
    Evaluation eval = new Evaluation(0, 0, 0, 0, 0);
    for (ClassificationInstance inst : data) {
      int hx = h.label(inst.x);
      updateEvaluation(eval, inst.y, hx, tagOfInterest);
    }
    return eval;
View Full Code Here

  public static Evaluation[] eval(LinearClassifier h,
      ArrayList<ClassificationInstance> data) {
    Evaluation[] res = new Evaluation[data.get(0).yAlphabet.size()];
    for (int y = 0; y < data.get(0).yAlphabet.size(); y++) {
      res[y] = new Evaluation(0, 0, 0, 0, 0);
    }
    for (ClassificationInstance inst : data) {
      int hx = h.label(inst.x);
      for (int y = 0; y < data.get(0).yAlphabet.size(); y++) {
        updateEvaluation(res[y], inst.y, hx, y);
View Full Code Here

   *            tag wrt which we compute tp,fp,fn
   * @return
   */
  public static Evaluation eval(LinearClassifier h,
      ClassificationInstance inst, int tagOfInterest) {
    Evaluation eval = new Evaluation(0, 0, 0, 0, 0);
    int hx = h.label(inst.x);
    updateEvaluation(eval, inst.y, hx, tagOfInterest);
    return eval;
  }
View Full Code Here

    updateEvaluation(eval, inst.y, hx, tagOfInterest);
    return eval;
  }

  public static Evaluation eval(int truth, int guess, int tagOfInterest) {
    Evaluation eval = new Evaluation(0, 0, 0, 0, 0);
    updateEvaluation(eval, truth, guess, tagOfInterest);
    return eval;
  }
View Full Code Here

TOP

Related Classes of types.Evaluation

Copyright © 2018 www.massapicom. 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.