code: public String[] getBestLabels(double[] scores, float ratioOfBest) {
  		if (ratioOfBest > 1 | ratioOfBest <= 0)
  			throw new RuntimeException(
  					"ratioOfBest shoudl be > 0 and <= 1 but got " + ratioOfBest);
  		TreeMap<Double, String> sortedMap = new TreeMap<Double, String>();
  		double max = -Double.MAX_VALUE;
  		double min = Double.MAX_VALUE;
  		for (int d = 0; d < scores.length; d++) {
  			if (scores[d] > max) {
  				max = scores[d];
  			}
  			if (scores[d] < min) {
  				min = scores[d];
  			}
  		}
  
  		double scaleFactor = max - min;
  		for (int x = 0; x < scores.length; x++) {
  			double newScore = ((scores[x] - min) / scaleFactor);
  			sortedMap.put(newScore, this.lexicon.getLabel(x));
  		}
  
  		// find cutoffpoint -> we know that the best label will have a value of 1
  		double threshold = ratioOfBest;
  
  		List<String> labelsKept = new ArrayList<String>();
  		Iterator<Entry<Double, String>> pairs = sortedMap.entrySet().iterator();
  		while (pairs.hasNext()) {
  			Entry<Double, String> pair = pairs.next();
  			if (pair.getKey() >= threshold)
  				labelsKept.add(pair.getValue());
  		}
  		return (String[]) labelsKept.toArray(new String[labelsKept.size()]);
  	}
docs: *
  Scales the scores between 0 and 1