InputType
- The type of the input to categorize.CategoryType
- The type of the output categories.public class EvaluatorToCategorizerAdapter<InputType,CategoryType> extends AbstractCategorizer<InputType,CategoryType>
EvaluatorToCategorizerAdapter
class implements an adapter from a
general Evaluator
to be a Categorizer
. This is done by just
having a reference to the evaluator plus a field to store the list of
possible output categories.Modifier and Type | Class and Description |
---|---|
static class |
EvaluatorToCategorizerAdapter.Learner<InputType,CategoryType>
The
EvaluatorToCategorizerAdapter.Learner class implements a
simple supervised learner for a EvaluatorToCategorizerAdapter . |
categories
Constructor and Description |
---|
EvaluatorToCategorizerAdapter()
Creates a new
EvaluatorToCategorizerAdapter . |
EvaluatorToCategorizerAdapter(Evaluator<? super InputType,? extends CategoryType> evaluator,
java.util.Set<CategoryType> categories)
Creates a new
EvaluatorToCategorizerAdapter . |
Modifier and Type | Method and Description |
---|---|
CategoryType |
evaluate(InputType input)
Evaluates the function on the given input and returns the output.
|
Evaluator<? super InputType,? extends CategoryType> |
getEvaluator()
Gets the evaluator that is to be adapted to be a categorizer.
|
void |
setCategories(java.util.Set<CategoryType> categories)
Sets the Set of possible categories, which are the output values.
|
void |
setEvaluator(Evaluator<? super InputType,? extends CategoryType> evaluator)
Sets the evaluator that is to be adapted to be a categorizer.
|
clone, getCategories
public EvaluatorToCategorizerAdapter()
EvaluatorToCategorizerAdapter
.public EvaluatorToCategorizerAdapter(Evaluator<? super InputType,? extends CategoryType> evaluator, java.util.Set<CategoryType> categories)
EvaluatorToCategorizerAdapter
.evaluator
- The evaluator to turn into a categorizer.categories
- The list of possible output categories.public CategoryType evaluate(InputType input)
Evaluator
input
- The input to evaluate.public Evaluator<? super InputType,? extends CategoryType> getEvaluator()
public void setEvaluator(Evaluator<? super InputType,? extends CategoryType> evaluator)
evaluator
- The evaluator to adapt.public void setCategories(java.util.Set<CategoryType> categories)
AbstractCategorizer
setCategories
in class AbstractCategorizer<InputType,CategoryType>
categories
- The list of possible output categories.