InputType - The type of the input to categorize.CategoryType - The type of the output categories.public class BinaryVersusCategorizer<InputType,CategoryType> extends AbstractDiscriminantCategorizer<InputType,CategoryType,java.lang.Double>
| Modifier and Type | Class and Description |
|---|---|
static class |
BinaryVersusCategorizer.Learner<InputType,CategoryType>
A learner for the
BinaryVersusCategorizer. |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<Pair<CategoryType,CategoryType>,Evaluator<? super InputType,java.lang.Boolean>> |
categoryPairsToEvaluatorMap
Maps false-true category pairs .
|
categories| Constructor and Description |
|---|
BinaryVersusCategorizer()
Creates a new
BinaryVersusCategorizer. |
BinaryVersusCategorizer(java.util.Set<CategoryType> categories)
Creates a new
BinaryVersusCategorizer with the given
categories and an empty set of evaluators. |
BinaryVersusCategorizer(java.util.Set<CategoryType> categories,
java.util.Map<Pair<CategoryType,CategoryType>,Evaluator<? super InputType,java.lang.Boolean>> categoryPairsToEvaluatorMap)
Creates a new
BinaryVersusCategorizer. |
| Modifier and Type | Method and Description |
|---|---|
BinaryVersusCategorizer<InputType,CategoryType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
DefaultWeightedValueDiscriminant<CategoryType> |
evaluateWithDiscriminant(InputType input)
Evaluate the categorizer on the given input to produce the expected
category plus a discriminant for later producing an ordering of how well
items fit into that category.
|
java.util.Map<Pair<CategoryType,CategoryType>,Evaluator<? super InputType,java.lang.Boolean>> |
getCategoryPairsToEvaluatorMap()
Gets the mapping of false-true category pairs to the binary categorizer
that distinguishes them.
|
void |
setCategoryPairsToEvaluatorMap(java.util.Map<Pair<CategoryType,CategoryType>,Evaluator<? super InputType,java.lang.Boolean>> categoryPairsToEvaluatorMap)
Sets the mapping of false-true category pairs to the binary categorizer
that distinguishes them.
|
evaluategetCategories, setCategoriesequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCategoriesprotected java.util.Map<Pair<CategoryType,CategoryType>,Evaluator<? super InputType,java.lang.Boolean>> categoryPairsToEvaluatorMap
public BinaryVersusCategorizer()
BinaryVersusCategorizer.public BinaryVersusCategorizer(java.util.Set<CategoryType> categories)
BinaryVersusCategorizer with the given
categories and an empty set of evaluators.categories - The possible output categories.public BinaryVersusCategorizer(java.util.Set<CategoryType> categories, java.util.Map<Pair<CategoryType,CategoryType>,Evaluator<? super InputType,java.lang.Boolean>> categoryPairsToEvaluatorMap)
BinaryVersusCategorizer.categories - The possible output categories.categoryPairsToEvaluatorMap - The mapping of category pairs to their binary categorizer.public BinaryVersusCategorizer<InputType,CategoryType> clone()
AbstractCloneableSerializableObject 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 CloneableSerializableclone in class AbstractCategorizer<InputType,CategoryType>public DefaultWeightedValueDiscriminant<CategoryType> evaluateWithDiscriminant(InputType input)
DiscriminantCategorizerinput - The input value to categorize with a discriminatepublic java.util.Map<Pair<CategoryType,CategoryType>,Evaluator<? super InputType,java.lang.Boolean>> getCategoryPairsToEvaluatorMap()
public void setCategoryPairsToEvaluatorMap(java.util.Map<Pair<CategoryType,CategoryType>,Evaluator<? super InputType,java.lang.Boolean>> categoryPairsToEvaluatorMap)
categoryPairsToEvaluatorMap - The mapping of category pairs to their binary categorizer.