|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.evaluation.NominalPrediction
public class NominalPrediction
Encapsulates an evaluatable nominal prediction: the predicted probability distribution plus the actual class value.
| Field Summary |
|---|
| 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 |
java.lang.String |
getRevision()
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 |
margin()
Calculates the prediction margin. |
double |
predicted()
Gets the predicted class value. |
java.lang.String |
toString()
Gets a human readable representation of this prediction. |
double |
weight()
Gets the weight assigned to this prediction. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 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 Predictionpublic double predicted()
predicted in interface Predictionpublic double weight()
weight in interface Predictionpublic 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.
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRevision()
getRevision in interface RevisionHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||