mvpa2.clfs.transerror.chisquare

mvpa2.clfs.transerror.chisquare(obs, exp='uniform')

Compute the chisquare value of a contingency table with arbitrary dimensions.

Parameters:

obs : array

Observations matrix

exp : (‘uniform’, ‘indep_rows’) or array, optional

Matrix of expected values of the same size as obs. If no array is given, then for ‘uniform’ – evenly distributes all observations. In ‘indep_rows’ case contingency table takes into account frequencies relative across different columns, so, if the contingency table is predictions vs targets, it would account for dis-balance among different targets. Although ‘uniform’ is the default, for confusion matrices ‘indep_rows’ is preferable.

Returns:

tuple

chisquare-stats, associated p-value (upper tail)