nl_tokens: Train the classifier with all the given documents and identify the best possible threshold simply by running over all relevant scores and determining the value of feedback function ( F1 by default )
pl_tokens: function ( dataset ) { _ . times ( 3 , function ( n ) { dataset = _ . shuffle ( dataset ) } ) if ( this . numOfFoldsForThresholdCalculation > 1 ) { thresholds = [ ] best_performances = [ ] average_performances = [ ] median_performances = [ ] partitions . partitions_consistent ( dataset , this . numOfFoldsForThresholdCalculation , ( function ( trainSet , testSet , index ) { this . multiclassClassifier . trainBatch ( trainSet ) ; <mask> = this . receiveScores ( testSet ) performance = this . CalculatePerformance ( result [ 0 ] , testSet , result [ 1 ] ) best_performances . push ( performance ) } ) . bind ( this ) ) this . stats = best_performances threshold_average = ulist . average ( _ . pluck ( best_performances , 'Threshold' ) ) threshold_median = ulist . median ( _ . pluck ( best_performances , 'Threshold' ) ) Threshold = threshold_median } else { dataset = partitions . partition ( dataset , 1 , Math . round ( dataset . length * this . devsetsize ) ) trainSet = dataset [ 'train' ] testSet = dataset [ 'test' ] this . multiclassClassifier . trainBatch ( trainSet ) ; result = this . receiveScores ( testSet ) performance = this . CalculatePerformance ( result [ 0 ] , testSet , result [ 1 ] ) Threshold = performance [ 'Threshold' ] } this . multiclassClassifier . threshold = Threshold }