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

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<Vectorizable>
                  extended by gov.sandia.cognition.learning.function.categorization.VectorElementThresholdCategorizer
All Implemented Interfaces:
Evaluator<Vectorizable,Boolean>, BinaryCategorizer<Vectorizable>, Categorizer<Vectorizable,Boolean>, DiscriminantBinaryCategorizer<Vectorizable>, DiscriminantCategorizer<Vectorizable,Boolean,Double>, ThresholdBinaryCategorizer<Vectorizable>, CloneableSerializable, Serializable, Cloneable

public class VectorElementThresholdCategorizer
extends AbstractThresholdBinaryCategorizer<Vectorizable>

The VectorElementThresholdCategorizer class implements a BinaryCategorizer that categorizes an input vector by applying a threshold to an element in a the vector. The threshold is a greater-than-or-equal threshold. f(x) = x[i] >= t

Since:
2.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
static int DEFAULT_INDEX
          The default index is -1.
protected  int index
          The index to apply the threshold to.
 
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
VectorElementThresholdCategorizer()
          Creates a new instance of VectorElementThresholdCategorizer.
VectorElementThresholdCategorizer(int index, double threshold)
          Creates a new instance of VectorElementThresholdCategorizer.
VectorElementThresholdCategorizer(VectorElementThresholdCategorizer other)
          Creates a new instance of VectorElementThresholdCategorizer.
 
Method Summary
 VectorElementThresholdCategorizer clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
protected  double evaluateWithoutThreshold(Vectorizable input)
          Computes the discriminant.
 int getIndex()
          Gets the vector index that the threshold is being applied to.
 void setIndex(int index)
          Sets the vector index that the threshold is being applied to.
 String toString()
           
 
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, 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
 

Field Detail

DEFAULT_INDEX

public static final int DEFAULT_INDEX
The default index is -1.

See Also:
Constant Field Values

index

protected int index
The index to apply the threshold to.

Constructor Detail

VectorElementThresholdCategorizer

public VectorElementThresholdCategorizer()
Creates a new instance of VectorElementThresholdCategorizer.


VectorElementThresholdCategorizer

public VectorElementThresholdCategorizer(int index,
                                         double threshold)
Creates a new instance of VectorElementThresholdCategorizer.

Parameters:
index - The index to threshold.
threshold - The threshold to apply.

VectorElementThresholdCategorizer

public VectorElementThresholdCategorizer(VectorElementThresholdCategorizer other)
Creates a new instance of VectorElementThresholdCategorizer.

Parameters:
other - The object to copy.
Method Detail

clone

public VectorElementThresholdCategorizer 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 CloneableSerializable
Overrides:
clone in class AbstractCloneableSerializable
Returns:
A clone of this object.

evaluateWithoutThreshold

protected double evaluateWithoutThreshold(Vectorizable 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<Vectorizable>
Parameters:
input - Input to map onto the real number line.
Returns:
Real-value equivalent of the input.

getIndex

public int getIndex()
Gets the vector index that the threshold is being applied to.

Returns:
The vector index to threshold.

setIndex

public void setIndex(int index)
Sets the vector index that the threshold is being applied to.

Parameters:
index - The vector index to threshold.

toString

public String toString()
Overrides:
toString in class Object