|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJama.Matrix
org.android.activityminer.model.evaluation.ConfusionMatrix
public final class ConfusionMatrix
Representation of the confusion matrix for the classes.
It is based on JAMA ( a
basic linear algebra package for Java ).
Field Summary | |
---|---|
private android.support.v4.util.LongSparseArray<Integer> |
mapClassId2Index
The mapping for indices to the class identifiers |
private static long |
serialVersionUID
The serial version id. |
Constructor Summary | |
---|---|
ConfusionMatrix(ActivityLabel classLabel)
Constructor for a confusion matrix of a single class |
|
ConfusionMatrix(long[] classIds)
Constructor |
Method Summary | |
---|---|
void |
add(long predictedClassId,
long trueClassId)
Method to add a prediction result from the evaluation test run to the matrix. |
long |
getClassIdentifier(int columnIndex)
Getter for the class identifier for a given column index. |
long[] |
getClassIdentifierArrayForMatrixIndices()
Getter for the class identifiers for the matrix indices as array. |
long[] |
getClassIdentifiers()
Getter for the class identifiers. |
double |
getCorrectCount()
Getter for the count of correct predicted samples. |
double |
getErrorRate()
Getter for the error rate. |
double |
getIncorrectCount()
Getter for the count of incorrect predicted samples. |
int |
getIndexForClassId(long classId)
Getter for the index of a class identifier in the symmetric matrix |
PerClassResult |
getPerClassResult(long classId)
Getter for the values of the binary confusion matrix for the given class identifier. |
double |
getTotalCount()
Getter for the total count of predicted samples. |
int |
size()
Getter for the size. |
Methods inherited from class Jama.Matrix |
---|
arrayLeftDivide, arrayLeftDivideEquals, arrayRightDivide, arrayRightDivideEquals, arrayTimes, arrayTimesEquals, chol, clone, cond, constructWithCopy, copy, det, eig, get, getArray, getArrayCopy, getColumnDimension, getColumnPackedCopy, getMatrix, getMatrix, getMatrix, getMatrix, getRowDimension, getRowPackedCopy, identity, inverse, lu, minus, minusEquals, norm1, norm2, normF, normInf, plus, plusEquals, print, print, print, print, qr, random, rank, read, set, setMatrix, setMatrix, setMatrix, setMatrix, solve, solveTranspose, svd, times, times, timesEquals, trace, transpose, uminus |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private final android.support.v4.util.LongSparseArray<Integer> mapClassId2Index
Constructor Detail |
---|
public ConfusionMatrix(ActivityLabel classLabel)
classLabel
- the class labelpublic ConfusionMatrix(long[] classIds)
classIds
- the class identifiersMethod Detail |
---|
public final long[] getClassIdentifiers()
public final long getClassIdentifier(int columnIndex)
columnIndex
- the column index
public final int size()
public final void add(long predictedClassId, long trueClassId)
predictedClassId
- the predicted class identifiertrueClassId
- the true class identifierpublic final int getIndexForClassId(long classId) throws InvalidParameterException
classId
- the class identifier
InvalidParameterException
- if class label is unknownpublic final double getTotalCount()
public final double getCorrectCount()
public final double getIncorrectCount()
public final double getErrorRate()
public final PerClassResult getPerClassResult(long classId)
classId
- the class identifier
public long[] getClassIdentifierArrayForMatrixIndices()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |