de.fu_berlin.ties.classify
Class PredictionDistribution

java.lang.Object
  extended by de.fu_berlin.ties.classify.PredictionDistribution
Direct Known Subclasses:
WinnowDistribution

public class PredictionDistribution
extends Object

A distribution over the classes predicted by a classifier. The contained predictions are sorted in descending order, so the most probably prediction comes first.

Version:
$Revision: 1.7 $, $Date: 2004/09/06 17:21:59 $, $Author: siefkes $
Author:
Christian Siefkes

Constructor Summary
PredictionDistribution()
          Creates a new instance.
PredictionDistribution(Prediction pred)
          Creates a new instance, adding a prediction.
 
Method Summary
 void add(Prediction pred)
          Adds a new prediction to this distribution.
 Prediction best()
          Returns the best (most probably) prediction in this distribution.
 Iterator iterator()
          Returns an iterator over the predictions in this distribution, in descending order (most probably class comes first).
 int size()
          Returns the number of predictions (classes) in this distribution.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PredictionDistribution

public PredictionDistribution()
Creates a new instance.


PredictionDistribution

public PredictionDistribution(Prediction pred)
Creates a new instance, adding a prediction.

Parameters:
pred - the prediction to add
Method Detail

add

public void add(Prediction pred)
         throws IllegalArgumentException
Adds a new prediction to this distribution.

Parameters:
pred - the prediction to add
Throws:
IllegalArgumentException - if the distribution already contains a prediction considered equal by PredictionComparator

best

public Prediction best()
Returns the best (most probably) prediction in this distribution.

Returns:
the best prediction

iterator

public Iterator iterator()
Returns an iterator over the predictions in this distribution, in descending order (most probably class comes first).

Returns:
an iterator over the predictions

size

public int size()
Returns the number of predictions (classes) in this distribution.

Returns:
the number of predictions

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object
Returns:
a textual representation


Copyright © 2003-2004 Christian Siefkes. All Rights Reserved.