code: public Confusion getConfusionMatrixAtThreshold(double threshold) {
          Point p = getPointAtThreshold(threshold);
          int idx = p.idx;
          int tn = totalCount - (tpCount[idx] + fpCount[idx] + fnCount[idx]);
          return new Confusion(p, tpCount[idx], fpCount[idx], fnCount[idx], tn);
      }
docs: Get the binary confusion matrix for the given threshold. As per {@link #getPointAtThreshold(double)},
  if the threshold is not found exactly, the next highest threshold exceeding the requested threshold
  is returned
  
  @param threshold Threshold at which to get the confusion matrix
  @return Binary confusion matrix