All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hex.genmodel.easy.prediction.SortedClassProbability Maven / Gradle / Ivy

There is a newer version: 3.46.0.5
Show newest version
package hex.genmodel.easy.prediction;

/**
 * Class probability.
 *
 * Produced by method sortClassProbabilities() in class EasyPredictModelWrapper.
 */
public class SortedClassProbability implements Comparable {
  /**
   * Name of this class level.
   */
  public String name;

  /**
   * Prediction value for this class level.
   */
  public double probability;

  /**
   * Comparison implementation for this object type.
   *
   * @param o The other object to compare to.
   * @return -1, 0, 1 if this object is less than, equal, or greather than the other object.
   */
  @Override
  public int compareTo(Object o) {
    SortedClassProbability other = (SortedClassProbability) o;
    if (this.probability < other.probability) {
      return -1;
    }
    else if (this.probability > other.probability) {
      return 1;
    }
    else {
      return 0;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy