InputType
- Input to the discriminant function.public class ScalarFunctionToBinaryCategorizerAdapter<InputType> extends AbstractThresholdBinaryCategorizer<InputType>
Modifier and Type | Field and Description |
---|---|
protected Evaluator<? super InputType,java.lang.Double> |
evaluator
The scalar evaluator.
|
DEFAULT_THRESHOLD
BINARY_CATEGORIES
Constructor and Description |
---|
ScalarFunctionToBinaryCategorizerAdapter()
Creates a new
ScalarFunctionToBinaryCategorizerAdapter . |
ScalarFunctionToBinaryCategorizerAdapter(Evaluator<? super InputType,java.lang.Double> evaluator)
Creates a new
ScalarFunctionToBinaryCategorizerAdapter with the
given evaluator and a default threshold of 0.0. |
ScalarFunctionToBinaryCategorizerAdapter(Evaluator<? super InputType,java.lang.Double> evaluator,
double threshold)
Creates a new
ScalarFunctionToBinaryCategorizerAdapter with the
given evaluator and threshold. |
Modifier and Type | Method and Description |
---|---|
ScalarFunctionToBinaryCategorizerAdapter<InputType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
protected double |
evaluateWithoutThreshold(InputType input)
Computes the discriminant.
|
Evaluator<? super InputType,java.lang.Double> |
getEvaluator()
Gets the scalar function that the adapter wraps.
|
void |
setEvaluator(Evaluator<? super InputType,java.lang.Double> evaluator)
Sets the scalar function that the adapter wraps.
|
evaluateAsDouble, getThreshold, setThreshold
evaluate, evaluateWithDiscriminant
getCategories
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
evaluateWithDiscriminant
getCategories
public ScalarFunctionToBinaryCategorizerAdapter()
ScalarFunctionToBinaryCategorizerAdapter
.public ScalarFunctionToBinaryCategorizerAdapter(Evaluator<? super InputType,java.lang.Double> evaluator)
ScalarFunctionToBinaryCategorizerAdapter
with the
given evaluator and a default threshold of 0.0.evaluator
- The scalar function to adapt.public ScalarFunctionToBinaryCategorizerAdapter(Evaluator<? super InputType,java.lang.Double> evaluator, double threshold)
ScalarFunctionToBinaryCategorizerAdapter
with the
given evaluator and threshold.evaluator
- The scalar function to adapt.threshold
- The threshold to use.public ScalarFunctionToBinaryCategorizerAdapter<InputType> 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(InputType input)
AbstractThresholdBinaryCategorizer
evaluateWithoutThreshold
in class AbstractThresholdBinaryCategorizer<InputType>
input
- Input to map onto the real number line.public Evaluator<? super InputType,java.lang.Double> getEvaluator()