com.mancrd.ahah.classifier
Class ClassifierOutput

java.lang.Object
  extended by com.mancrd.ahah.classifier.ClassifierOutput
All Implemented Interfaces:
gnu.trove.procedure.TIntFloatProcedure

public final class ClassifierOutput
extends Object
implements gnu.trove.procedure.TIntFloatProcedure

This DTO encapsulates an activation map from a classifier and has convenience methods to get at the relevant data

Author:
alexnugent

Constructor Summary
ClassifierOutput()
          Constructor
 
Method Summary
 boolean execute(int label, float weight)
           
 LabelOutput getBestGuess()
          Returns the highest ranked label or best-guess label
 String getBestGuessLabelAboveThreshold(double confidenceThreshold)
          Returns the highest ranked label above the given confidence threshold
 LabelOutput getBestGuessLabelOuputAboveThreshold(double confidenceThreshold)
          Returns the highest ranked label above the given confidence threshold
 LabelOutput getLabelOutput(String label)
           
 LabelOutput[] getLabelOutputs()
           
 Set<LabelOutput> getLabelOutputSet(double confidenceThreshold)
          Gets the Activation objects sorted by activation above a given confidence threshold
 Set<String> getLabelSet(double confidenceThreshold)
          Gets the Activation objects sorted by activation above a given confidence threshold
 List<LabelOutput> getSortedLabelOutputs(double confidenceThreshold)
          Gets the Activation objects sorted by activation above a given confidence threshold
 List<String> getSortedLabels()
          Gets the Activation objects sorted by activation above a given confidence threshold
 List<String> getSortedLabels(double confidenceThreshold)
          Gets the Activation objects sorted by activation above a given confidence threshold
 float getTotalConfidence(double confidenceThreshold)
          Returns the sum total activation for all labels in the output that exceed the given threshold.
 void translateLabels(gnu.trove.map.hash.TIntObjectHashMap<String> labelReverseMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassifierOutput

public ClassifierOutput()
Constructor

Parameters:
activations -
Method Detail

getLabelOutputs

public LabelOutput[] getLabelOutputs()

translateLabels

public void translateLabels(gnu.trove.map.hash.TIntObjectHashMap<String> labelReverseMap)

getTotalConfidence

public float getTotalConfidence(double confidenceThreshold)
Returns the sum total activation for all labels in the output that exceed the given threshold.

Parameters:
activationThreshold -
Returns:

getSortedLabelOutputs

public List<LabelOutput> getSortedLabelOutputs(double confidenceThreshold)
Gets the Activation objects sorted by activation above a given confidence threshold

Parameters:
activationThreshold -
Returns:

getLabelOutputSet

public Set<LabelOutput> getLabelOutputSet(double confidenceThreshold)
Gets the Activation objects sorted by activation above a given confidence threshold

Parameters:
activationThreshold -
Returns:

getSortedLabels

public List<String> getSortedLabels(double confidenceThreshold)
Gets the Activation objects sorted by activation above a given confidence threshold

Parameters:
activationThreshold -
Returns:

getLabelSet

public Set<String> getLabelSet(double confidenceThreshold)
Gets the Activation objects sorted by activation above a given confidence threshold

Parameters:
activationThreshold -
Returns:

getSortedLabels

public List<String> getSortedLabels()
Gets the Activation objects sorted by activation above a given confidence threshold

Parameters:
activationThreshold -
Returns:

getBestGuess

public LabelOutput getBestGuess()
Returns the highest ranked label or best-guess label

Returns:

getLabelOutput

public LabelOutput getLabelOutput(String label)

getBestGuessLabelOuputAboveThreshold

public LabelOutput getBestGuessLabelOuputAboveThreshold(double confidenceThreshold)
Returns the highest ranked label above the given confidence threshold

Returns:

getBestGuessLabelAboveThreshold

public String getBestGuessLabelAboveThreshold(double confidenceThreshold)
Returns the highest ranked label above the given confidence threshold

Returns:

execute

public boolean execute(int label,
                       float weight)
Specified by:
execute in interface gnu.trove.procedure.TIntFloatProcedure


Copyright © 2013–2014 M. Alexander Nugent Consulting, Research and Devlopment. All rights reserved.