RESULT
- Type of analysed dataCLASS
- Type of classes predicted by the classifierOBJECT
- Type of objects classified by the classifierpublic class ClassificationEvaluator<RESULT extends AnalysisResult,CLASS,OBJECT> extends Object implements Evaluator<Map<OBJECT,ClassificationResult<CLASS>>,RESULT>
Evaluator
for the evaluation of classification
experiments.Modifier and Type | Field and Description |
---|---|
protected Map<OBJECT,Set<CLASS>> |
actual |
protected ClassificationAnalyser<RESULT,CLASS,OBJECT> |
analyser |
protected Classifier<CLASS,OBJECT> |
classifier |
protected Collection<OBJECT> |
objects |
Modifier and Type | Method and Description |
---|---|
RESULT |
analyse(Map<OBJECT,ClassificationResult<CLASS>> predicted)
Analyse the raw data produced by a call to
Evaluator.evaluate() and return the analysed data. |
Map<OBJECT,ClassificationResult<CLASS>> |
evaluate()
Run, or evaluate the system, returning the raw data.
|
Map<OBJECT,Set<CLASS>> |
getExpected()
Get the expected classes for each instance
|
protected Classifier<CLASS,OBJECT> classifier
protected ClassificationAnalyser<RESULT extends AnalysisResult,CLASS,OBJECT> analyser
protected Collection<OBJECT> objects
public ClassificationEvaluator(Classifier<CLASS,OBJECT> classifier, Collection<OBJECT> objects, Map<OBJECT,Set<CLASS>> actual, ClassificationAnalyser<RESULT,CLASS,OBJECT> analyser)
ClassificationEvaluator
with the given
classifier, set of objects to classify, ground truth ("actual") data and
an ClassificationAnalyser
.classifier
- the classifierobjects
- the objects to classifyactual
- the ground truthanalyser
- the analyserpublic ClassificationEvaluator(Classifier<CLASS,OBJECT> classifier, Map<OBJECT,Set<CLASS>> actual, ClassificationAnalyser<RESULT,CLASS,OBJECT> analyser)
ClassificationEvaluator
with the given
classifier, ground truth ("actual") data and an
ClassificationAnalyser
.
The objects to classify are taken from the Map.keySet()
of the
ground truth.
classifier
- the classifieractual
- the ground truthanalyser
- the analyserpublic ClassificationEvaluator(Classifier<CLASS,OBJECT> classifier, GroupedDataset<CLASS,? extends ListDataset<OBJECT>,OBJECT> actual, ClassificationAnalyser<RESULT,CLASS,OBJECT> analyser)
ClassificationEvaluator
with the given
classifier, ground truth ("actual") data and an
ClassificationAnalyser
.
The ground-truth classes to are taken from the
GroupedDataset.getGroups()
of the "actual" GroupedDataset
, and the objects are assembled by concatenating all of the
ListDataset
s within the "actual" dataset.
classifier
- the classifieractual
- the dataset containing instances and ground truthsanalyser
- the analyserpublic ClassificationEvaluator(Map<OBJECT,ClassificationResult<CLASS>> results, Map<OBJECT,Set<CLASS>> actual, ClassificationAnalyser<RESULT,CLASS,OBJECT> analyser)
ClassificationEvaluator
with the given
pre-classified results, the ground truth ("actual") data and an
ClassificationAnalyser
.
Internally, this constructor wraps a simple Classifier
implementation around the results.
results
- the pre-classified resultsactual
- the ground truthanalyser
- the analyserpublic Map<OBJECT,ClassificationResult<CLASS>> evaluate()
Evaluator
evaluate
in interface Evaluator<Map<OBJECT,ClassificationResult<CLASS>>,RESULT extends AnalysisResult>
public RESULT analyse(Map<OBJECT,ClassificationResult<CLASS>> predicted)
Evaluator
Evaluator.evaluate()
and return the analysed data.analyse
in interface Evaluator<Map<OBJECT,ClassificationResult<CLASS>>,RESULT extends AnalysisResult>
predicted
- the raw data.public Map<OBJECT,Set<CLASS>> getExpected()