nl_tokens: Record the result of a new classes experiment in a hash manner . Doesn t allowed to do a inner output all stats are put in hash
pl_tokens: function ( expectedClasses , actualClasses , logTruePositives ) { var explanations = { } ; explanations [ 'TP' ] = [ ] ; explanations [ 'FP' ] = [ ] ; explanations [ 'FN' ] = [ ] ; actualClasses = hash . normalized ( actualClasses ) ; expectedClasses = hash . normalized ( expectedClasses ) ; var allTrue = true ; for ( var actualClass in actualClasses ) { if ( actualClass in expectedClasses ) { if ( logTruePositives ) explanations [ 'TP' ] . push ( actualClass ) ; this . TP ++ ; } else { explanations [ 'FP' ] . push ( actualClass ) ; this . FP ++ ; allTrue = false ; } } for ( var expectedClass in expectedClasses ) { if ( ! ( expectedClass in actualClasses ) ) { explanations [ 'FN' ] . push ( expectedClass ) ; this . FN ++ ; allTrue = false ; } } if ( allTrue ) { // if ((logTruePositives)&& (!only_false_cases)) explanations.push("\t\t*** ALL TRUE!"); this . TRUE ++ ; } this . count ++ ; _ . each ( explanations , function ( value , key , list ) { // explanations[key] = _.sortBy(explanations[key], function(num){ num }); explanations [ <mask> ] . sort ( ) } , this ) if ( explanations [ 'FP' ] . length == 0 ) delete explanations [ 'FP' ] if ( explanations [ 'FN' ] . length == 0 ) delete explanations [ 'FN' ] return explanations ; }