public double falseNegativeRate ( EvaluationAveraging averaging ) { int nClasses = confusion ( ) . getClasses ( ) . size ( ) ; if ( averaging == EvaluationAveraging . Macro ) { double macroFNR = 0.0 ; for ( int i = 0 ; i < nClasses ; i ++ ) { macroFNR += falseNegativeRate ( i ) ; } macroFNR /= nClasses ; return macroFNR ; } else if ( averaging == EvaluationAveraging . Micro ) { long fnCount = 0 ; long tnCount = 0 ; for ( int i = 0 ; i < nClasses ; i ++ ) { fnCount += falseNegatives . getCount ( i ) ; tnCount += trueNegatives . getCount ( i ) ; } return EvaluationUtils . falseNegativeRate ( fnCount , tnCount , DEFAULT_EDGE_VALUE ) ; } else { throw new UnsupportedOperationException ( "Unknown averaging approach: " + averaging ) ; } }
Calculate the average false negative rate for all classes - can specify whether macro or micro averaging should be used