public class MulticlassClassificationEvaluator extends Evaluator
Modifier and Type | Class and Description |
---|---|
protected class |
MulticlassClassificationEvaluator.ClassStats |
Modifier and Type | Field and Description |
---|---|
protected HashMap<Label,MulticlassClassificationEvaluator.ClassStats> |
classStats |
protected int |
correct |
protected List<Label> |
labels |
protected int |
total |
protected int |
totalFn |
protected int |
totalFp |
protected int |
totalTn |
protected int |
totalTp |
Constructor and Description |
---|
MulticlassClassificationEvaluator(List<Label> labels)
Initialize a new F1Evaluator that will work on the specified classes
|
Modifier and Type | Method and Description |
---|---|
void |
addCount(Example test,
Prediction prediction)
This method should be implemented in the subclasses to update counters useful to compute the performance measure
|
void |
clear()
Clear all the counters for a new processing.
|
protected void |
compute()
This method is intented to force the computation of the performance measure.
|
MulticlassClassificationEvaluator |
duplicate()
Returns a new instance of this Evaluator
|
float |
getAccuracy()
Returns the accuracy
|
float |
getF1For(Label l)
Return the f1 for the specified label
|
float |
getFnFor(Label l)
Return the false negatives for the specified label
|
float |
getFpFor(Label l)
Return the false positives for the specified label
|
float |
getMacroF1()
Return the macro-F1
|
float |
getMacroPrecision()
Return the macro-precision
|
float |
getMacroRecall()
Return the macro-recall
|
float |
getMeanF1()
Deprecated.
|
float |
getMeanF1For(ArrayList<Label> ls)
Return the mean of the F1 scores considering the specified labels only
|
float |
getMicroF1()
Returns the micro-f1
|
float |
getMicroPrecision()
Returns the micro-precision
|
float |
getMicroRecall()
Returns the micro-recall
|
float |
getOverallF1()
Deprecated.
|
float |
getOverallPrecision()
Deprecated.
|
float |
getOverallRecall()
Deprecated.
|
float |
getPrecisionFor(Label l)
Return the precision for the specified label
|
float |
getRecallFor(Label l)
Return the recall for the specified label
|
float |
getTnFor(Label l)
Return the true negatives for the specified label
|
float |
getTpFor(Label l)
Return the true positives for the specified label
|
void |
printCounters(Label l)
Print the counters of the specified Label l.
|
String |
toString() |
getPerformanceMeasure
protected HashMap<Label,MulticlassClassificationEvaluator.ClassStats> classStats
protected int total
protected int correct
protected int totalTp
protected int totalTn
protected int totalFp
protected int totalFn
public void addCount(Example test, Prediction prediction)
Evaluator
protected void compute()
Evaluator
public float getPrecisionFor(Label l)
public float getRecallFor(Label l)
public float getF1For(Label l)
public float getTpFor(Label l)
public float getTnFor(Label l)
public float getFpFor(Label l)
public float getFnFor(Label l)
public float getAccuracy()
public float getMicroPrecision()
public float getMicroRecall()
public float getMicroF1()
@Deprecated public float getOverallPrecision()
@Deprecated public float getOverallRecall()
@Deprecated public float getOverallF1()
@Deprecated public float getMeanF1()
public float getMacroPrecision()
public float getMacroRecall()
public float getMacroF1()
public float getMeanF1For(ArrayList<Label> ls)
public void clear()
public void printCounters(Label l)
l
- public MulticlassClassificationEvaluator duplicate()
Evaluator
Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.