T
- The type of the output.public interface ConfusionMatrix<T extends Classifiable<T>>
Classifiable
s.
We interpret it as follows:
C[i, j] = k
means "the TRUE class 'j' was PREDICTED to be class 'i' a total of 'k' times".
In other words, the row indices correspond to the model's predictions, and the column indices correspond to the ground truth.
Modifier and Type | Method and Description |
---|---|
double |
confusion(T predictedLabel,
T trueLabel)
The number of times the supplied predicted label was returned for the supplied true class.
|
default double |
fn()
The total number of false negatives.
|
double |
fn(T cls)
The number of false negatives for the supplied label.
|
default double |
fp()
The total number of false positives.
|
double |
fp(T cls)
The number of false positives for the supplied label.
|
ImmutableOutputInfo<T> |
getDomain()
Returns the classification domain that this confusion matrix operates over.
|
static <T extends Classifiable<T>> |
sumOverOutputs(ImmutableOutputInfo<T> domain,
ToDoubleFunction<T> getter)
Sums the supplied getter over the domain.
|
double |
support()
The number of examples this confusion matrix has seen.
|
double |
support(T cls)
The number of examples with this true label this confusion matrix has seen.
|
default double |
tn()
The total number of true negatives.
|
double |
tn(T cls)
The number of true negatives for the supplied label.
|
default double |
tp()
The total number of true positives.
|
double |
tp(T cls)
The number of true positives for the supplied label.
|
ImmutableOutputInfo<T> getDomain()
double support()
double support(T cls)
cls
- The label.double tp(T cls)
cls
- The label.double fp(T cls)
cls
- The label.double fn(T cls)
cls
- The label.double tn(T cls)
cls
- The label.double confusion(T predictedLabel, T trueLabel)
predictedLabel
- The predicted label.trueLabel
- The true label.predictedLabel
when the true label was trueLabel
.default double tp()
default double fp()
default double fn()
default double tn()
static <T extends Classifiable<T>> double sumOverOutputs(ImmutableOutputInfo<T> domain, ToDoubleFunction<T> getter)
T
- The type of the output.domain
- The domain to sum over.getter
- The getter to use.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.