public class VectorElementThresholdCategorizer extends AbstractThresholdBinaryCategorizer<Vectorizable>
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] >= tModifier and Type | Field and Description |
---|---|
static int |
DEFAULT_INDEX
The default index is -1.
|
protected int |
index
The index to apply the threshold to.
|
DEFAULT_THRESHOLD
BINARY_CATEGORIES
Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.String |
toString() |
evaluateAsDouble, getThreshold, setThreshold
evaluate, evaluateWithDiscriminant
getCategories
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
evaluateWithDiscriminant
getCategories
public static final int DEFAULT_INDEX
protected int index
public VectorElementThresholdCategorizer()
VectorElementThresholdCategorizer
.public VectorElementThresholdCategorizer(int index, double threshold)
VectorElementThresholdCategorizer
.index
- The index to threshold.threshold
- The threshold to apply.public VectorElementThresholdCategorizer(VectorElementThresholdCategorizer other)
VectorElementThresholdCategorizer
.other
- The object to copy.public VectorElementThresholdCategorizer clone()
AbstractCloneableSerializable
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.clone
in interface CloneableSerializable
clone
in class AbstractCloneableSerializable
protected double evaluateWithoutThreshold(Vectorizable input)
AbstractThresholdBinaryCategorizer
evaluateWithoutThreshold
in class AbstractThresholdBinaryCategorizer<Vectorizable>
input
- Input to map onto the real number line.public int getIndex()
public void setIndex(int index)
index
- The vector index to threshold.public java.lang.String toString()
toString
in class java.lang.Object