类 NominalPrediction

java.lang.Object
weka.classifiers.evaluation.NominalPrediction
所有已实现的接口:
Serializable, Prediction, RevisionHandler

public class NominalPrediction extends Object implements Prediction, Serializable, RevisionHandler
Encapsulates an evaluatable nominal prediction: the predicted probability distribution plus the actual class value.
版本:
$Revision: 1.12 $
作者:
Len Trigg (len@reeltwo.com)
另请参阅:
  • 字段概要

    从接口继承的字段 weka.classifiers.evaluation.Prediction

    MISSING_VALUE
  • 构造器概要

    构造器
    构造器
    说明
    NominalPrediction(double actual, double[] distribution)
    Creates the NominalPrediction object with a default weight of 1.0.
    NominalPrediction(double actual, double[] distribution, double weight)
    Creates the NominalPrediction object.
  • 方法概要

    修饰符和类型
    方法
    说明
    double
    Gets the actual class value.
    double[]
    Gets the predicted probabilities
    Returns the revision string.
    static double[]
    makeDistribution(double predictedClass, int numClasses)
    Convert a single prediction into a probability distribution with all zero probabilities except the predicted value which has probability 1.0.
    static double[]
    makeUniformDistribution(int numClasses)
    Creates a uniform probability distribution -- where each of the possible classes is assigned equal probability.
    double
    Calculates the prediction margin.
    double
    Gets the predicted class value.
    Gets a human readable representation of this prediction.
    double
    Gets the weight assigned to this prediction.

    从类继承的方法 java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 构造器详细资料

    • NominalPrediction

      public NominalPrediction(double actual, double[] distribution)
      Creates the NominalPrediction object with a default weight of 1.0.
      参数:
      actual - the actual value, or MISSING_VALUE.
      distribution - the predicted probability distribution. Use NominalPrediction.makeDistribution() if you only know the predicted value.
    • NominalPrediction

      public NominalPrediction(double actual, double[] distribution, double weight)
      Creates the NominalPrediction object.
      参数:
      actual - the actual value, or MISSING_VALUE.
      distribution - the predicted probability distribution. Use NominalPrediction.makeDistribution() if you only know the predicted value.
      weight - the weight assigned to the prediction.
  • 方法详细资料

    • distribution

      public double[] distribution()
      Gets the predicted probabilities
      返回:
      the predicted probabilities
    • actual

      public double actual()
      Gets the actual class value.
      指定者:
      actual 在接口中 Prediction
      返回:
      the actual class value, or MISSING_VALUE if no prediction was made.
    • predicted

      public double predicted()
      Gets the predicted class value.
      指定者:
      predicted 在接口中 Prediction
      返回:
      the predicted class value, or MISSING_VALUE if no prediction was made.
    • weight

      public double weight()
      Gets the weight assigned to this prediction. This is typically the weight of the test instance the prediction was made for.
      指定者:
      weight 在接口中 Prediction
      返回:
      the weight assigned to this prediction.
    • margin

      public double margin()
      Calculates the prediction margin. This is defined as the difference between the probability predicted for the actual class and the highest predicted probability of the other classes.
      返回:
      the margin for this prediction, or MISSING_VALUE if either the actual or predicted value is missing.
    • makeDistribution

      public static double[] makeDistribution(double predictedClass, int numClasses)
      Convert a single prediction into a probability distribution with all zero probabilities except the predicted value which has probability 1.0. If no prediction was made, all probabilities are zero.
      参数:
      predictedClass - the index of the predicted class, or MISSING_VALUE if no prediction was made.
      numClasses - the number of possible classes for this nominal prediction.
      返回:
      the probability distribution.
    • makeUniformDistribution

      public static double[] makeUniformDistribution(int numClasses)
      Creates a uniform probability distribution -- where each of the possible classes is assigned equal probability.
      参数:
      numClasses - the number of possible classes for this nominal prediction.
      返回:
      the probability distribution.
    • toString

      public String toString()
      Gets a human readable representation of this prediction.
      覆盖:
      toString 在类中 Object
      返回:
      a human readable representation of this prediction.
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      返回:
      the revision