mulan.classifier.neural
Class ThresholdFunction

java.lang.Object
  extended by mulan.classifier.neural.ThresholdFunction
All Implemented Interfaces:
Serializable

public class ThresholdFunction
extends Object
implements Serializable

Implementation of a threshold function.

Version:
2012.02.27
Author:
Jozef Vilcek
See Also:
Serialized Form

Constructor Summary
ThresholdFunction(double[][] idealLabels, double[][] modelOutLabels)
          Creates a new instance of ThresholdFunction and builds the function based on input parameters.
 
Method Summary
 void build(double[][] idealLabels, double[][] modelOutLabels)
          Build a threshold function for based on input data.
 double computeThreshold(double[] labelsConfidences)
          Computes a threshold value, based on learned parameters, for given labels confidences.
protected  double[] getFunctionParameters()
          Returns parameters learned by the threshold function in last build.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThresholdFunction

public ThresholdFunction(double[][] idealLabels,
                         double[][] modelOutLabels)
Creates a new instance of ThresholdFunction and builds the function based on input parameters.

Parameters:
idealLabels - the ideal output for each input patterns, which a model should output
modelOutLabels - the real output of a model for each input pattern
Throws:
IllegalArgumentException - if dimensions of input arrays does not match
See Also:
build(double[][], double[][])
Method Detail

computeThreshold

public double computeThreshold(double[] labelsConfidences)
Computes a threshold value, based on learned parameters, for given labels confidences.

Parameters:
labelsConfidences - the labels confidences
Returns:
the threshold value
Throws:
IllegalArgumentException - if the dimension of labels confidences does not match the dimension of learned parameters of threshold function.

build

public void build(double[][] idealLabels,
                  double[][] modelOutLabels)
Build a threshold function for based on input data. The threshold function is build for a particular model.

Parameters:
idealLabels - the ideal output for each input patterns, which a model should output. First index is expected to be number of examples and second is the label index.
modelOutLabels - the real output of a model for each input pattern. First index is expected to be number of examples and second is the label index.
Throws:
IllegalArgumentException - if dimensions of input arrays does not match

getFunctionParameters

protected double[] getFunctionParameters()
Returns parameters learned by the threshold function in last build. Based on these parameters the functions is computing thresholds for label confidences.
Support for unit tests ...

Returns:
parameters