Class MultiLabelConfusionMatrix
java.lang.Object
org.tribuo.multilabel.evaluation.MultiLabelConfusionMatrix
- All Implemented Interfaces:
ConfusionMatrix<MultiLabel>
A
ConfusionMatrix which accepts MultiLabels.
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 TypeMethodDescriptiondoubleconfusion(MultiLabel predicted, MultiLabel truth) The number of times the supplied predicted label was returned for the supplied true class.doublefn(MultiLabel cls) The number of false negatives for the supplied label.doublefp(MultiLabel cls) The number of false positives for the supplied label.Returns the classification domain that this confusion matrix operates over.doublesupport()The number of examples this confusion matrix has seen.doublesupport(MultiLabel cls) The number of examples with this true label this confusion matrix has seen.doubletn(MultiLabel cls) The number of true negatives for the supplied label.toString()doubletp(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, waitMethods inherited from interface org.tribuo.classification.evaluation.ConfusionMatrix
fn, fp, tn, tp
-
Constructor Details
-
MultiLabelConfusionMatrix
-
-
Method Details
-
support
Description copied from interface:ConfusionMatrixThe number of examples with this true label this confusion matrix has seen.- Specified by:
supportin interfaceConfusionMatrix<MultiLabel>- Parameters:
cls- The label.- Returns:
- The number of examples.
-
getDomain
Description copied from interface:ConfusionMatrixReturns the classification domain that this confusion matrix operates over.- Specified by:
getDomainin interfaceConfusionMatrix<MultiLabel>- Returns:
- The classification domain.
-
support
Description copied from interface:ConfusionMatrixThe number of examples this confusion matrix has seen.- Specified by:
supportin interfaceConfusionMatrix<MultiLabel>- Returns:
- The number of examples.
-
tp
Description copied from interface:ConfusionMatrixThe number of true positives for the supplied label.- Specified by:
tpin interfaceConfusionMatrix<MultiLabel>- Parameters:
cls- The label.- Returns:
- The number of examples.
-
fp
Description copied from interface:ConfusionMatrixThe number of false positives for the supplied label.- Specified by:
fpin interfaceConfusionMatrix<MultiLabel>- Parameters:
cls- The label.- Returns:
- The number of examples.
-
fn
Description copied from interface:ConfusionMatrixThe number of false negatives for the supplied label.- Specified by:
fnin interfaceConfusionMatrix<MultiLabel>- Parameters:
cls- The label.- Returns:
- The number of examples.
-
tn
Description copied from interface:ConfusionMatrixThe number of true negatives for the supplied label.- Specified by:
tnin interfaceConfusionMatrix<MultiLabel>- Parameters:
cls- The label.- Returns:
- The number of examples.
-
confusion
Description copied from interface:ConfusionMatrixThe number of times the supplied predicted label was returned for the supplied true class.- Specified by:
confusionin interfaceConfusionMatrix<MultiLabel>- Parameters:
predicted- The predicted label.truth- The true label.- Returns:
- The number of examples predicted as
predictedLabelwhen the true label wastrueLabel.
-
toString
-