C
- the class of instances that represent the classification categoriespublic abstract class RankingQueryOperationClassifier<C> extends java.lang.Object implements UpdatableClassifier<LocalAbstractObject,C>
RankingQueryOperation
on an encapsulated algorithm and computes the classification using encapsulated
classifier that processes the iterator of RankedAbstractObject
s.Constructor and Description |
---|
RankingQueryOperationClassifier(Classifier<? super RankingQueryOperation,C> classifier,
Algorithm algorithm,
java.lang.String executedOperationParameter)
Creates a new kNN classifier.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addClasifiedObject(LocalAbstractObject object,
C classification)
Adds a classified object to this classifier.
|
Classification<C> |
classify(LocalAbstractObject object,
Parametric parameters)
Classifies the given
object into zero, one, or several categories C . |
protected abstract RankingQueryOperation |
createOperation(LocalAbstractObject object)
Creates a ranking operation to be executed to get the candidate list for classification.
|
java.lang.Class<? extends C> |
getCategoriesClass()
Returns the class of instances that represent the classification categories (classes).
|
RankingQueryOperation |
getExecutedOperation(Parametric parameters)
Returns the executed operation stored by this classifier in the given parameters.
|
boolean |
removeClasifiedObject(LocalAbstractObject object)
Removes a classified object from this classifier.
|
public RankingQueryOperationClassifier(Classifier<? super RankingQueryOperation,C> classifier, Algorithm algorithm, java.lang.String executedOperationParameter)
classifier
- the classifier used to compute the object classificationalgorithm
- the algorithm that supplies the similar objectsexecutedOperationParameter
- the name of the parameter to put the executed operation into when classifyingpublic Classification<C> classify(LocalAbstractObject object, Parametric parameters) throws ClassificationException
Classifier
object
into zero, one, or several categories C
.classify
in interface Classifier<LocalAbstractObject,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 objectprotected abstract RankingQueryOperation createOperation(LocalAbstractObject object)
object
- the object to classifypublic boolean addClasifiedObject(LocalAbstractObject object, C classification) throws ClassificationException
UpdatableClassifier
addClasifiedObject
in interface UpdatableClassifier<LocalAbstractObject,C>
object
- the object to addclassification
- the object's classificationClassificationException
- if there was a problem adding the object to this classifierpublic boolean removeClasifiedObject(LocalAbstractObject object) throws ClassificationException
UpdatableClassifier
removeClasifiedObject
in interface UpdatableClassifier<LocalAbstractObject,C>
object
- the object to removeClassificationException
- if there was a problem removing the object from this classifierpublic java.lang.Class<? extends C> getCategoriesClass()
Classifier
getCategoriesClass
in interface Classifier<LocalAbstractObject,C>
public RankingQueryOperation getExecutedOperation(Parametric parameters)
parameters
- the parameters to get the executed operation from