|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.evaluation.NominalPrediction
Encapsulates an evaluatable nominal prediction: the predicted probability distribution plus the actual class value.
Field Summary | |
private double |
m_Actual
The actual class value |
private double[] |
m_Distribution
The predicted probabilities |
private double |
m_Predicted
The predicted class value |
private double |
m_Weight
The weight assigned to this prediction |
(package private) static long |
serialVersionUID
Remove this if you change this class so that serialization would be affected. |
Fields inherited from interface weka.classifiers.evaluation.Prediction |
MISSING_VALUE |
Constructor Summary | |
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. |
Method Summary | |
double |
actual()
Gets the actual class value. |
double[] |
distribution()
Gets the predicted probabilities |
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 |
margin()
Calculates the prediction margin. |
double |
predicted()
Gets the predicted class value. |
java.lang.String |
toString()
Gets a human readable representation of this prediction. |
private void |
updatePredicted()
Determines the predicted class (doesn't detect multiple classifications). |
double |
weight()
Gets the weight assigned to this prediction. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static final long serialVersionUID
private double[] m_Distribution
private double m_Actual
private double m_Predicted
private double m_Weight
Constructor Detail |
public NominalPrediction(double actual, double[] distribution)
actual
- the actual value, or MISSING_VALUE.distribution
- the predicted probability distribution. Use
NominalPrediction.makeDistribution() if you only know the predicted value.public NominalPrediction(double actual, double[] distribution, double weight)
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.Method Detail |
public double[] distribution()
public double actual()
actual
in interface Prediction
public double predicted()
predicted
in interface Prediction
public double weight()
weight
in interface Prediction
public double margin()
public static double[] makeDistribution(double predictedClass, int numClasses)
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.
public static double[] makeUniformDistribution(int numClasses)
numClasses
- the number of possible classes for this nominal
prediction.
private void updatePredicted()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |