Class MultiLabelConfusionMatrix
java.lang.Object
org.tribuo.multilabel.evaluation.MultiLabelConfusionMatrix
- All Implemented Interfaces:
ConfusionMatrix<MultiLabel>
A
ConfusionMatrix
which accepts MultiLabel
s.
In a multi-label confusion matrix M,
tn = M[:, 0, 0] fn = M[:, 1, 0] tp = M[:, 1, 1] fp = M[:, 0, 1]
For class-wise values,
tn(class i) = M[i, 0, 0] fn(class i) = M[i, 1, 0] tp(class i) = M[i, 1, 1] fp(class i) = M[i, 0, 1]
-
Constructor Summary
ConstructorsConstructorDescriptionMultiLabelConfusionMatrix
(Model<MultiLabel> model, List<Prediction<MultiLabel>> predictions) -
Method Summary
Modifier and TypeMethodDescriptiondouble
confusion
(MultiLabel predicted, MultiLabel truth) The number of times the supplied predicted label was returned for the supplied true class.double
fn
(MultiLabel cls) The number of false negatives for the supplied label.double
fp
(MultiLabel cls) The number of false positives for the supplied label.Returns the classification domain that this confusion matrix operates over.double
support()
The number of examples this confusion matrix has seen.double
support
(MultiLabel cls) The number of examples with this true label this confusion matrix has seen.double
tn
(MultiLabel cls) The number of true negatives for the supplied label.toString()
double
tp
(MultiLabel cls) The number of true positives for the supplied label.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.tribuo.classification.evaluation.ConfusionMatrix
fn, fp, tn, tp
-
Constructor Details
-
MultiLabelConfusionMatrix
-
-
Method Details
-
support
Description copied from interface:ConfusionMatrix
The number of examples with this true label this confusion matrix has seen.- Specified by:
support
in interfaceConfusionMatrix<MultiLabel>
- Parameters:
cls
- The label.- Returns:
- The number of examples.
-
getDomain
Description copied from interface:ConfusionMatrix
Returns the classification domain that this confusion matrix operates over.- Specified by:
getDomain
in interfaceConfusionMatrix<MultiLabel>
- Returns:
- The classification domain.
-
support
Description copied from interface:ConfusionMatrix
The number of examples this confusion matrix has seen.- Specified by:
support
in interfaceConfusionMatrix<MultiLabel>
- Returns:
- The number of examples.
-
tp
Description copied from interface:ConfusionMatrix
The number of true positives for the supplied label.- Specified by:
tp
in interfaceConfusionMatrix<MultiLabel>
- Parameters:
cls
- The label.- Returns:
- The number of examples.
-
fp
Description copied from interface:ConfusionMatrix
The number of false positives for the supplied label.- Specified by:
fp
in interfaceConfusionMatrix<MultiLabel>
- Parameters:
cls
- The label.- Returns:
- The number of examples.
-
fn
Description copied from interface:ConfusionMatrix
The number of false negatives for the supplied label.- Specified by:
fn
in interfaceConfusionMatrix<MultiLabel>
- Parameters:
cls
- The label.- Returns:
- The number of examples.
-
tn
Description copied from interface:ConfusionMatrix
The number of true negatives for the supplied label.- Specified by:
tn
in interfaceConfusionMatrix<MultiLabel>
- Parameters:
cls
- The label.- Returns:
- The number of examples.
-
confusion
Description copied from interface:ConfusionMatrix
The number of times the supplied predicted label was returned for the supplied true class.- Specified by:
confusion
in interfaceConfusionMatrix<MultiLabel>
- Parameters:
predicted
- The predicted label.truth
- The true label.- Returns:
- The number of examples predicted as
predictedLabel
when the true label wastrueLabel
.
-
toString
-