classification
Class Prediction

java.lang.Object
  extended by classification.Prediction

public class Prediction
extends java.lang.Object

This class represents a prediction about some attribute of an instance from a data set.


Field Summary
static double AVERAGE_CONFIDENCE
          Used to indicate that a prediction should be considered to have confidence equal to the average confidence of any group of predictions it is in.
 
Constructor Summary
Prediction(int instance, java.lang.String attribute, java.lang.String value, double confidence)
          Creates a new prediction with the given values.
 
Method Summary
 java.lang.String getAttribute()
          The data attribute the prediction is for.
 double getConfidence()
          The confidence of the prediction.
 int getInstance()
          The number of the data instance the prediction is for
static double getMeanConfidence(java.util.Collection<Prediction> predictions)
          Determines the average confidence in a collection of predictions, and sets all list members with AVERAGE_CONFIDENCE to have that confidence.
 java.lang.String getValue()
          The value of the prediction.
 void setConfidence(double confidence)
          Sets the confidence of the prediction.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AVERAGE_CONFIDENCE

public static final double AVERAGE_CONFIDENCE
Used to indicate that a prediction should be considered to have confidence equal to the average confidence of any group of predictions it is in.

See Also:
Constant Field Values
Constructor Detail

Prediction

public Prediction(int instance,
                  java.lang.String attribute,
                  java.lang.String value,
                  double confidence)
Creates a new prediction with the given values.

Parameters:
instance - The instance number of the prediction
attribute - The data attribute the prediction is for
value - The value of the prediction
confidence - The confidence of the prediction.
Method Detail

getMeanConfidence

public static double getMeanConfidence(java.util.Collection<Prediction> predictions)
Determines the average confidence in a collection of predictions, and sets all list members with AVERAGE_CONFIDENCE to have that confidence. If none of the listed predictions have non-average confidence, AVERAGE_CONFIDENCE will be returned.

Parameters:
predictions - The list of predictions to find/set an average confidence for
Returns:
The average confidence of the predictions in the list

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAttribute

public java.lang.String getAttribute()
The data attribute the prediction is for.

Returns:
The name of the prediction's attribute

getInstance

public int getInstance()
The number of the data instance the prediction is for

Returns:
The prediction's instance number

getValue

public java.lang.String getValue()
The value of the prediction.

Returns:
The prediction's value

getConfidence

public double getConfidence()
The confidence of the prediction.

Returns:
The prediction's confidence

setConfidence

public void setConfidence(double confidence)
Sets the confidence of the prediction.

Parameters:
confidence - The desired confidence for the prediction