T
- the class of the input instance for the classificationC
- the class of the output classification categoriespublic final class PipelineClassifier<T,C> extends java.lang.Object implements Classifier<T,C>
T
and the last one must provide a Classification
with categories C
.
Each classifier in the pipeline also must accept the result of the previous classifier.Constructor and Description |
---|
PipelineClassifier(java.lang.Class<? extends C> categoriesClass,
Classifier<T,?> initialClassifier,
Classifier... pipelineClassifiers)
Creates a pipeline of classifiers.
|
Modifier and Type | Method and Description |
---|---|
Classification<C> |
classify(T object,
Parametric parameters)
Classifies the given
object into zero, one, or several categories C . |
java.lang.Class<? extends C> |
getCategoriesClass()
Returns the class of instances that represent the classification categories (classes).
|
public PipelineClassifier(java.lang.Class<? extends C> categoriesClass, Classifier<T,?> initialClassifier, Classifier... pipelineClassifiers)
initialClassifier
- the first classifier in the pipelinecategoriesClass
- the class of the output classification categoriespipelineClassifiers
- public Classification<C> classify(T object, Parametric parameters) throws ClassificationException
Classifier
object
into zero, one, or several categories C
.classify
in interface Classifier<T,C>
object
- the object to classifyparameters
- additional parameters for the classification;
the values for the parameters are specific to a given classifier
implementation and can be updated during the process if they are ModifiableParametric
ClassificationException
- if there was an error classifying the objectpublic java.lang.Class<? extends C> getCategoriesClass()
Classifier
getCategoriesClass
in interface Classifier<T,C>