org.strbio.math
Class SimMatrix

java.lang.Object
  extended by org.strbio.math.IMatrix
      extended by org.strbio.math.StatsMatrix
          extended by org.strbio.math.SimMatrix

public class SimMatrix
extends StatsMatrix

This is a NxN matrix, where data[i][j] indicates the number of times something was actually i, but predicted to be j.

Version:
1.0
Author:
JMC

Field Summary
 
Fields inherited from class org.strbio.math.IMatrix
data
 
Constructor Summary
SimMatrix()
           
SimMatrix(IMatrix x)
           
SimMatrix(int n)
           
SimMatrix(int[][] x)
           
 
Method Summary
 void addPrediction(int actually, int predicted)
          Add a prediction, which was actually category a, but predicted to be in category b.
 double matthews(int a)
          Return the Matthews correlation coefficient for category A.
 double pctRight()
          return percent right, from 0 to 100.
 double pctRightActually(int a)
          Return the percent right only for predictions of items which actually belonged to category A.
 double pctRightPred(int a)
          Return the percent right only for predictions of items which were predicted to be in category A.
 int rightActually(int a)
          How many of the items that actually belonged to category A were predicted correctly?
 int rightPred(int a)
          How many of the items predicted to be in category A were predicted correctly?
 int totalActually(int a)
          How many items are there in category A?
 int totalPred(int a)
          How many items predicted to be in category A?
 int wrongActually(int a)
          How many of the items that actually belonged to category A were predicted incorrectly?
 int wrongPred(int a)
          How many of the items predicted to be in category A were predicted incorrectly?
 
Methods inherited from class org.strbio.math.StatsMatrix
clear
 
Methods inherited from class org.strbio.math.IMatrix
add, add, cols, equals, isEmpty, load, load, load, max, min, multiply, multiply, multiply, print, rows, save, save, saveBinary, saveBinary, setValue, setValueAt, subtract, subtract, valueAt
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimMatrix

public SimMatrix()

SimMatrix

public SimMatrix(int n)

SimMatrix

public SimMatrix(IMatrix x)

SimMatrix

public SimMatrix(int[][] x)
Method Detail

pctRight

public final double pctRight()
return percent right, from 0 to 100.

Specified by:
pctRight in class StatsMatrix

matthews

public final double matthews(int a)
Return the Matthews correlation coefficient for category A.

Specified by:
matthews in class StatsMatrix

pctRightActually

public final double pctRightActually(int a)
Return the percent right only for predictions of items which actually belonged to category A.

Specified by:
pctRightActually in class StatsMatrix

rightActually

public final int rightActually(int a)
How many of the items that actually belonged to category A were predicted correctly?

Specified by:
rightActually in class StatsMatrix

wrongActually

public final int wrongActually(int a)
How many of the items that actually belonged to category A were predicted incorrectly?

Specified by:
wrongActually in class StatsMatrix

totalActually

public final int totalActually(int a)
How many items are there in category A?

Specified by:
totalActually in class StatsMatrix

addPrediction

public final void addPrediction(int actually,
                                int predicted)
Add a prediction, which was actually category a, but predicted to be in category b.


pctRightPred

public final double pctRightPred(int a)
Return the percent right only for predictions of items which were predicted to be in category A.


rightPred

public final int rightPred(int a)
How many of the items predicted to be in category A were predicted correctly?


wrongPred

public final int wrongPred(int a)
How many of the items predicted to be in category A were predicted incorrectly?


totalPred

public final int totalPred(int a)
How many items predicted to be in category A?