C
- the class of instances that represent the classification categoriespublic class ClassifierAlgorithm<C> extends Algorithm
Classifier
.
The algorithm process any RankingQueryOperation
by passing it to the classifier
and converting the the resulting classification items into AbstractObject
.Algorithm.AlgorithmConstructor
log, maximalConcurrentOperations
Constructor and Description |
---|
ClassifierAlgorithm(Classifier<? super RankingQueryOperation,C> classifier)
Creates a new instance of ClassifierAlgorithm for the given classifier.
|
Modifier and Type | Method and Description |
---|---|
protected void |
classificationToAnswer(Classification<C> classification,
RankingQueryOperation op)
Converts the given classification to the operation answer.
|
protected void |
classificationWithConfidenceToAnswer(ClassificationWithConfidence<C> classification,
RankingQueryOperation op)
Converts the given classification to the operation answer.
|
void |
classify(RankingQueryOperation op)
Execution of any
RankingQueryOperation . |
protected AbstractObject |
itemToObject(C item,
Classification<C> classification)
Convert a classification item to operation answer object.
|
afterStoreToFile, backgroundExecuteOperation, backgroundExecuteOperationIndependent, backgroundExecuteOperationWithStatistics, beforeStoreToFile, createBackgroundExecutionCallable, destroy, execute, executeMethodWithStringArguments, executeOperation, executeUsingNavDir, finalize, getAllRunningOperations, getAnnotatedConstructors, getAnnotatedConstructorsArray, getConstructorArgumentDescriptions, getConstructorDescription, getConstructorDescriptionSimple, getExecutorParamClasses, getFirstSupportedOperation, getName, getObjectClass, getObjectCount, getOperationStatistics, getOperationsThreadPool, getOperationSubClasses, getQueryAnswer, getQueryAnswer, getRunningOperationById, getRunningOperationsCount, getSupportedOperations, getSupportedOperations, methodExecute, resetOperationStatistics, restoreFromFile, restoreFromFile, setExecutedOperationsLogVerbosity, setOperationsThreadPool, setupStatsAndExecuteOperation, statisticsAfterOperation, statisticsBeforeOperation, storeToFile, terminateOperation, terminateOperation, waitBackgroundExecution
public ClassifierAlgorithm(Classifier<? super RankingQueryOperation,C> classifier)
RankingQueryOperation
as its argument.classifier
- the wrapped classifier that is used for query executionpublic void classify(RankingQueryOperation op) throws ClassificationException
RankingQueryOperation
.
The operation is passed to the classifier and
the resulting classification is converted to operation answer.op
- the operation the query object of which to classifyClassificationException
- if there was an error creating the classificationprotected void classificationToAnswer(Classification<C> classification, RankingQueryOperation op)
LocalAbstractObject.UNKNOWN_DISTANCE
.classification
- the classification to convertop
- the operation the answer of which to fillprotected void classificationWithConfidenceToAnswer(ClassificationWithConfidence<C> classification, RankingQueryOperation op)
classification
- the classification to convertop
- the operation the answer of which to fillprotected AbstractObject itemToObject(C item, Classification<C> classification)
NoDataObject
.item
- the classification item to convertclassification
- the classification from which the object originates