dist/multilabel/ThresholdClassifier.js
function(dataset) {
		list_of_scores = [];
		FN=0
		for (var i=0; i<dataset.length; ++i) 
		{
 			var scoresVector = this.multiclassClassifier.classify(dataset[i].input, false, true);

 			for (score in scoresVector)
 			{
 				if (dataset[i].output.indexOf(scoresVector[score][0])>-1)
 				{
 					scoresVector[score].push("+")
 					FN+=1
 				}
 				else {scoresVector[score].push("-")}

 				scoresVector[score].push(i)	
			}

 			list_of_scores = list_of_scores.concat(scoresVector)
  		}	

  		// list_of_scores = [['d',4],['b',2],['a',1],['c',3]]

		list_of_scores.sort((function(index){
		    return function(a, b){
	        return (a[index] === b[index] ? 0 : (a[index] < b[index] ? 1 : -1));
		    };
		})(1))

		return [list_of_scores, FN]
	}
function(dataset) {
		list_of_scores = [];
		FN=0
		for (var i=0; i<dataset.length; ++i) 
		{
 			var scoresVector = this.multiclassClassifier.classify(dataset[i].input, false, true);

 			for (score in scoresVector)
 			{
 				if (dataset[i].output.indexOf(scoresVector[score][0])>-1)
 				{
 					scoresVector[score].push("+")
 					FN+=1
 				}
 				else {scoresVector[score].push("-")}

 				scoresVector[score].push(i)	
			}

 			list_of_scores = list_of_scores.concat(scoresVector)
  		}	

  		// list_of_scores = [['d',4],['b',2],['a',1],['c',3]]

		list_of_scores.sort((function(index){
		    return function(a, b){
	        return (a[index] === b[index] ? 0 : (a[index] < b[index] ? 1 : -1));
		    };
		})(1))

		return [list_of_scores, FN]
	}
function ( dataset ) { list_of_scores = [ ] ; FN = 0 for ( var i = 0 ; i < dataset . length ; ++ i ) { var scoresVector = this . multiclassClassifier . classify ( dataset [ i ] . input , false , true ) ; for ( score in scoresVector ) { if ( dataset [ i ] . output . indexOf ( scoresVector [ score ] [ 0 ] ) > - 1 ) { scoresVector [ score ] . push ( "+" ) FN += 1 } else { scoresVector [ score ] . push ( "-" ) } scoresVector [ score ] . push ( i ) } list_of_scores = list_of_scores . concat ( scoresVector ) } // list_of_scores = [['d',4],['b',2],['a',1],['c',3]] list_of_scores . sort ( ( function ( index ) { return function ( a , b ) { return ( a [ index ] === b [ index ] ? 0 : ( a [ index ] < b [ index ] ? 1 : - 1 ) ) ; } ; } ) ( 1 ) ) return [ list_of_scores , FN ] }
/*
Classify dataset and return the scored result in sorted list
/ * Classify dataset and return the scored result in sorted list