gov.sandia.cognition.learning.function.categorization
Class ScalarThresholdBinaryCategorizer

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.function.categorization.AbstractBinaryCategorizer<InputType>
          extended by gov.sandia.cognition.learning.function.categorization.AbstractDiscriminantBinaryCategorizer<InputType>
              extended by gov.sandia.cognition.learning.function.categorization.AbstractThresholdBinaryCategorizer<Double>
                  extended by gov.sandia.cognition.learning.function.categorization.ScalarThresholdBinaryCategorizer
All Implemented Interfaces:
Evaluator<Double,Boolean>, BinaryCategorizer<Double>, Categorizer<Double,Boolean>, DiscriminantBinaryCategorizer<Double>, DiscriminantCategorizer<Double,Boolean,Double>, ThresholdBinaryCategorizer<Double>, Vectorizable, CloneableSerializable, Serializable, Cloneable

public class ScalarThresholdBinaryCategorizer
extends AbstractThresholdBinaryCategorizer<Double>
implements Vectorizable

The ScalarThresholdBinaryCategorizer class implements a binary categorizer that uses a threshold to categorize a given double.

Since:
2.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.sandia.cognition.learning.function.categorization.AbstractThresholdBinaryCategorizer
DEFAULT_THRESHOLD
 
Fields inherited from class gov.sandia.cognition.learning.function.categorization.AbstractBinaryCategorizer
BINARY_CATEGORIES
 
Constructor Summary
ScalarThresholdBinaryCategorizer()
          Creates a new instance of ScalarThresholdBinaryCategorizer.
ScalarThresholdBinaryCategorizer(double threshold)
          Creates a new instance of ScalarThresholdBinaryCategorizer.
ScalarThresholdBinaryCategorizer(ScalarThresholdBinaryCategorizer other)
          Copy constructor.
 
Method Summary
 ScalarThresholdBinaryCategorizer clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 void convertFromVector(Vector parameters)
          Converts the object from a Vector of parameters.
 Vector convertToVector()
          Converts the object to a vector.
protected  double evaluateWithoutThreshold(Double input)
          Computes the discriminant.
 
Methods inherited from class gov.sandia.cognition.learning.function.categorization.AbstractThresholdBinaryCategorizer
evaluateAsDouble, getThreshold, setThreshold
 
Methods inherited from class gov.sandia.cognition.learning.function.categorization.AbstractDiscriminantBinaryCategorizer
evaluate, evaluateWithDiscriminant
 
Methods inherited from class gov.sandia.cognition.learning.function.categorization.AbstractBinaryCategorizer
getCategories
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.learning.function.categorization.DiscriminantCategorizer
evaluateWithDiscriminant
 
Methods inherited from interface gov.sandia.cognition.learning.function.categorization.Categorizer
getCategories
 
Methods inherited from interface gov.sandia.cognition.evaluator.Evaluator
evaluate
 

Constructor Detail

ScalarThresholdBinaryCategorizer

public ScalarThresholdBinaryCategorizer()
Creates a new instance of ScalarThresholdBinaryCategorizer.


ScalarThresholdBinaryCategorizer

public ScalarThresholdBinaryCategorizer(double threshold)
Creates a new instance of ScalarThresholdBinaryCategorizer.

Parameters:
threshold - Threshold below which to consider "false" and greater than or equal to consider "true".

ScalarThresholdBinaryCategorizer

public ScalarThresholdBinaryCategorizer(ScalarThresholdBinaryCategorizer other)
Copy constructor.

Parameters:
other - BinaryClassicationFunction to clone
Method Detail

clone

public ScalarThresholdBinaryCategorizer clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface Vectorizable
Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractCloneableSerializable
Returns:
A clone of this object.

convertToVector

public Vector convertToVector()
Description copied from interface: Vectorizable
Converts the object to a vector.

Specified by:
convertToVector in interface Vectorizable
Returns:
The Vector form of the object.

convertFromVector

public void convertFromVector(Vector parameters)
Description copied from interface: Vectorizable
Converts the object from a Vector of parameters.

Specified by:
convertFromVector in interface Vectorizable
Parameters:
parameters - The parameters to incorporate.

evaluateWithoutThreshold

protected double evaluateWithoutThreshold(Double input)
Description copied from class: AbstractThresholdBinaryCategorizer
Computes the discriminant. This maps the input space onto the real line, which will then be passed to the threshold.

Specified by:
evaluateWithoutThreshold in class AbstractThresholdBinaryCategorizer<Double>
Parameters:
input - Input to map onto the real number line.
Returns:
Real-value equivalent of the input.