public final class MultiLabelConfusionMatrix extends Object implements ConfusionMatrix<MultiLabel>
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 and Description |
---|
MultiLabelConfusionMatrix(Model<MultiLabel> model,
List<Prediction<MultiLabel>> predictions) |
Modifier and Type | Method and Description |
---|---|
double |
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.
|
ImmutableOutputInfo<MultiLabel> |
getDomain()
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.
|
String |
toString() |
double |
tp(MultiLabel cls)
The number of true positives for the supplied label.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
fn, fp, sumOverOutputs, tn, tp
public MultiLabelConfusionMatrix(Model<MultiLabel> model, List<Prediction<MultiLabel>> predictions)
public double support(MultiLabel cls)
ConfusionMatrix
support
in interface ConfusionMatrix<MultiLabel>
cls
- The label.public ImmutableOutputInfo<MultiLabel> getDomain()
ConfusionMatrix
getDomain
in interface ConfusionMatrix<MultiLabel>
public double support()
ConfusionMatrix
support
in interface ConfusionMatrix<MultiLabel>
public double tp(MultiLabel cls)
ConfusionMatrix
tp
in interface ConfusionMatrix<MultiLabel>
cls
- The label.public double fp(MultiLabel cls)
ConfusionMatrix
fp
in interface ConfusionMatrix<MultiLabel>
cls
- The label.public double fn(MultiLabel cls)
ConfusionMatrix
fn
in interface ConfusionMatrix<MultiLabel>
cls
- The label.public double tn(MultiLabel cls)
ConfusionMatrix
tn
in interface ConfusionMatrix<MultiLabel>
cls
- The label.public double confusion(MultiLabel predicted, MultiLabel truth)
ConfusionMatrix
confusion
in interface ConfusionMatrix<MultiLabel>
predicted
- The predicted label.truth
- The true label.predictedLabel
when the true label was trueLabel
.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.