Package com.groiss.ml.classifier
Interface ClassificationService
public interface ClassificationService
Main interface for performing classifications.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild
(String classifierAssignmentName, ProcessDefinition process) Builds the classifier of specified classifier assignment of the passed process.<T> List<ClassificationResult<T>>
classifications
(String classifierAssignmentName, ActivityInstance activityInstance) Classifies the given activity instance using the classifier of the specified classifier assignment<T> ClassificationResult<T>
classify
(String classifierAssignmentName, ActivityInstance activityInstance) Classifies the given activity instance using the classifier of the specified classifier assignmentevaluate
(String classifierAssignmentName, ProcessDefinition process) Evaluates the classifier of specified classifier assignment of the passed process.boolean
executeClassification
(String classifierAssignmentName, ActivityInstance activityInstance, double minimumProbability) Executes a classification for the given activity instance using the classifier of the specified classifier assignment defined for the process definition of the passed activity instance, i.e. the classification is performed and the result is stored in the field defined as output field in that classifier assignment.boolean
executeClassifications
(ActivityInstance activityInstance, double minimumProbability) Executes classifications for the given activity instance using all classifier assignment defined for the process definition of the passed activity instance, i.e. the classifications are performed and their results are stored in the fields defined as output fields in the various classifier assignments.static ClassificationService
Returns an instance ofClassificationService
.void
registerClassifier
(Class<? extends Classifier> classifierClass) Registers a newClassifier
implementation with the given name.void
registerField
(Class<? extends ProcessField> fieldClass) Registers a newProcessField
implementation.
-
Field Details
-
ZERO_PROBABILITY
static final int ZERO_PROBABILITY- See Also:
-
-
Method Details
-
getService
Returns an instance ofClassificationService
.- Returns:
- an instance of this service class.
-
registerClassifier
Registers a newClassifier
implementation with the given name.- Parameters:
classifierClass
- the implementation class of the registered classifier
-
registerField
Registers a newProcessField
implementation.- Parameters:
fieldClass
- the implementation class of the registered field
-
build
Builds the classifier of specified classifier assignment of the passed process.- Parameters:
classifierAssignmentName
- the name of the classifier assignment which classifier shall be buildprocess
- the process definition of the classifier assignment- Returns:
- the evaluation result of the building process
-
evaluate
Evaluates the classifier of specified classifier assignment of the passed process.- Parameters:
classifierAssignmentName
- the name of the classifier assignment which classifier shall be evaluatedprocess
- the process definition of the classifier assignment- Returns:
- the result of the evaluation
-
classify
<T> ClassificationResult<T> classify(String classifierAssignmentName, ActivityInstance activityInstance) Classifies the given activity instance using the classifier of the specified classifier assignment- Parameters:
classifierAssignmentName
- the name of the classifier assignment which classifier shall be taken for the classificationactivityInstance
- the activity instance which shall be classified- Returns:
- the highest ranked result of the classification
-
classifications
<T> List<ClassificationResult<T>> classifications(String classifierAssignmentName, ActivityInstance activityInstance) Classifies the given activity instance using the classifier of the specified classifier assignment- Parameters:
classifierAssignmentName
- the name of the classifier assignment which classifier shall be taken for the classificationactivityInstance
- the activity instance which shall be classified- Returns:
- a list of classification result for each class supported by the classifier
-
executeClassification
boolean executeClassification(String classifierAssignmentName, ActivityInstance activityInstance, double minimumProbability) Executes a classification for the given activity instance using the classifier of the specified classifier assignment defined for the process definition of the passed activity instance, i.e. the classification is performed and the result is stored in the field defined as output field in that classifier assignment. If a minimum probability is specified an automatic storage of the result in the output field will only be performed if the probability of the classification result is greater or equals to that minimum probability. IfZERO_PROBABILITY
is passed storage will be performed in any case.- Parameters:
classifierAssignmentName
- the name of the classifier assignment which classifier shall be taken for the classificationactivityInstance
- the activity instance which shall be classifiedminimumProbability
- the minimum classification probability that must be met to trigger automatic storage- Returns:
- true if the form has been changed, false otherwise (which means that the field of the form already had the value of the performed classification or the classification did not meet the minimum probability)
-
executeClassifications
Executes classifications for the given activity instance using all classifier assignment defined for the process definition of the passed activity instance, i.e. the classifications are performed and their results are stored in the fields defined as output fields in the various classifier assignments. If a minimum probability is specified automatic storage of the results in the output fields will only be performed for those classifications which probability of the classification result is greater or equals to that minimum probability. IfZERO_PROBABILITY
is passed storage will be performed in any case.- Parameters:
activityInstance
- the activity instance which shall be classifiedminimumProbability
- the minimum classification probability that must be met to trigger automatic storage- Returns:
- true if the form has been changed by any of the executed classifications, false otherwise
-