C
- the class of instances that represent the classification categoriespublic class ParametricRankedObjectDistanceClassifier<C> extends java.lang.Object implements Classifier<java.util.Iterator<? extends RankedAbstractObject>,C>
ClassificationWithConfidence
from the given distance-ranked objects. The categories are derived from
the Parametric
parameter with the given name. The confidences of the
respective categories are the distance-ranks of the respective objects that
provide them. The overall classification is computed as the minimal distance-rank
of each category.Constructor and Description |
---|
ParametricRankedObjectDistanceClassifier(java.lang.Class<? extends C> categoriesClass,
java.lang.String categoriesParameterName)
Creates a new instance of ParametricRankedObjectDistanceClassifier.
|
Modifier and Type | Method and Description |
---|---|
ClassificationWithConfidence<C> |
classify(java.util.Iterator<? extends RankedAbstractObject> iterator,
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).
|
protected ClassificationWithConfidence<C> |
getClassification(RankedAbstractObject object,
Parametric parameters)
Retrieves the classification from the object.
|
public ParametricRankedObjectDistanceClassifier(java.lang.Class<? extends C> categoriesClass, java.lang.String categoriesParameterName)
categoriesClass
- the class of instances that represent the classification categoriescategoriesParameterName
- the name of the Parametric
parameter that contains the classification categoriespublic ClassificationWithConfidence<C> classify(java.util.Iterator<? extends RankedAbstractObject> iterator, Parametric parameters) throws ClassificationException
Classifier
object
into zero, one, or several categories C
.classify
in interface Classifier<java.util.Iterator<? extends RankedAbstractObject>,C>
iterator
- 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 objectprotected ClassificationWithConfidence<C> getClassification(RankedAbstractObject object, Parametric parameters)
object
must implement the Parametric
interface.
Note also that the rank of the object is used as the confidence.object
- the ranked object for which to get the classificationparameters
- 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
public java.lang.Class<? extends C> getCategoriesClass()
Classifier
getCategoriesClass
in interface Classifier<java.util.Iterator<? extends RankedAbstractObject>,C>