org.strbio.math
Class StatsMatrix

java.lang.Object
  extended by org.strbio.math.IMatrix
      extended by org.strbio.math.StatsMatrix
Direct Known Subclasses:
CorrectMatrix, SimMatrix

public abstract class StatsMatrix
extends IMatrix

This class describes a special kind of integer matrix which is used for keeping stats on how well a predictive procedure is performing. This is useful only for discrete predictions; i.e. there are N categories something can be in, and you want to predict it as one of these N (or at least eliminate some of the choices). There are 2 types of these matrices, called "similarity matrices" and "correctness matrices"; this is an abstract class that includes both.

Version:
1.0
Author:
JMC
See Also:
SimMatrix, CorrectMatrix

Field Summary
 
Fields inherited from class org.strbio.math.IMatrix
data
 
Constructor Summary
StatsMatrix()
           
StatsMatrix(IMatrix x)
           
StatsMatrix(int[][] x)
           
StatsMatrix(int c, int r)
           
 
Method Summary
 void clear()
          Clear all statistics.
abstract  double matthews(int a)
          Return the Matthews correlation coefficient for category A.
abstract  double pctRight()
          return percent right, from 0 to 100.
abstract  double pctRightActually(int a)
          Return the percent right only for predictions of items which actually belonged to category A.
abstract  int rightActually(int a)
          How many of the items that actually belonged to category A were predicted correctly?
abstract  int totalActually(int a)
          How many items are there in category A?
abstract  int wrongActually(int a)
          How many of the items that actually belonged to category A were predicted incorrectly?
 
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

StatsMatrix

public StatsMatrix()

StatsMatrix

public StatsMatrix(int c,
                   int r)

StatsMatrix

public StatsMatrix(IMatrix x)

StatsMatrix

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

clear

public final void clear()
Clear all statistics.


pctRight

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


matthews

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


pctRightActually

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


rightActually

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


wrongActually

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


totalActually

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