mulan.classifier
Class MultiLabelOutput

java.lang.Object
  extended by mulan.classifier.MultiLabelOutput

public class MultiLabelOutput
extends Object

Class representing the output of a MultiLabelLearner. This can be a bipartition of labels into true and false, a ranking of labels, or an array of confidence values for each label.

Author:
Grigorios Tsoumakas

Constructor Summary
MultiLabelOutput(boolean[] bipartition)
          Creates a new instance of MultiLabelOutput.
MultiLabelOutput(boolean[] bipartition, double[] someConfidences)
          Creates a new instance of MultiLabelOutput.
MultiLabelOutput(double[] probabilities)
          Creates a new instance of MultiLabelOutput.
MultiLabelOutput(double[] probabilities, double threshold)
          Creates a new instance of MultiLabelOutput.
MultiLabelOutput(int[] ranking)
          Creates a new instance of MultiLabelOutput.
 
Method Summary
 boolean equals(Object mlo)
          Tests if two MultiLabelOutput objects are equal
 boolean[] getBipartition()
          Gets bipartition of labels.
 double[] getConfidences()
          Gets confidences of labels.
 int[] getRanking()
          Gets ranking of labels.
 boolean hasBipartition()
          Determines whether the MultiLabelOutput has bipartition of labels.
 boolean hasConfidences()
          Determines whether the MultiLabelOutput has confidences of labels.
 int hashCode()
           
 boolean hasRanking()
          Determines whether the MultiLabelOutput has ranking of labels.
static int[] ranksFromValues(double[] values)
          Creates a ranking form specified values/confidences.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiLabelOutput

public MultiLabelOutput(boolean[] bipartition)
Creates a new instance of MultiLabelOutput.

Parameters:
bipartition - bipartition of labels
Throws:
ArgumentNullException - if bipartitions is null.

MultiLabelOutput

public MultiLabelOutput(int[] ranking)
Creates a new instance of MultiLabelOutput.

Parameters:
ranking - ranking of labels
Throws:
ArgumentNullException - if ranking is null

MultiLabelOutput

public MultiLabelOutput(double[] probabilities,
                        double threshold)
Creates a new instance of MultiLabelOutput. It creates a ranking based on the probabilities and a bipartition based on a threshold for the probabilities.

Parameters:
probabilities - score of each label
threshold - threshold to output bipartition based on probabilities
Throws:
ArgumentNullException - if probabilities is null

MultiLabelOutput

public MultiLabelOutput(double[] probabilities)
Creates a new instance of MultiLabelOutput. It creates a ranking based on the probabilities.

Parameters:
probabilities - score of each label
Throws:
ArgumentNullException - if probabilities is null

MultiLabelOutput

public MultiLabelOutput(boolean[] bipartition,
                        double[] someConfidences)
Creates a new instance of MultiLabelOutput.

Parameters:
bipartition - bipartition of labels
someConfidences - values of labels
Throws:
ArgumentNullException - if either of the input parameters is null or their dimensions do not match
Method Detail

getBipartition

public boolean[] getBipartition()
Gets bipartition of labels.

Returns:
the bipartition

hasBipartition

public boolean hasBipartition()
Determines whether the MultiLabelOutput has bipartition of labels.

Returns:
true if has bipartition; otherwise false

getRanking

public int[] getRanking()
Gets ranking of labels.

Returns:
the ranking

hasRanking

public boolean hasRanking()
Determines whether the MultiLabelOutput has ranking of labels.

Returns:
true if has ranking; otherwise false

getConfidences

public double[] getConfidences()
Gets confidences of labels.

Returns:
the confidences

hasConfidences

public boolean hasConfidences()
Determines whether the MultiLabelOutput has confidences of labels.

Returns:
true if has confidences; otherwise false

ranksFromValues

public static int[] ranksFromValues(double[] values)
Creates a ranking form specified values/confidences.

Parameters:
values - the values/confidences to be converted to ranking
Returns:
the ranking of given values/confidences

equals

public boolean equals(Object mlo)
Tests if two MultiLabelOutput objects are equal

Overrides:
equals in class Object
Parameters:
mlo - a MultiLabelOutput object
Returns:
true if the given object represents a MultiLabelOutput equivalent to this MultiLabelOutput, false otherwise

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object