code: public int getTopNCorrectCount() {
          if (confusion == null)
              return 0;
          if (topN <= 1) {
              int nClasses = confusion().getClasses().size();
              int countCorrect = 0;
              for (int i = 0; i < nClasses; i++) {
                  countCorrect += confusion().getCount(i, i);
              }
              return countCorrect;
          }
          return topNCorrectCount;
      }
docs: Return the number of correct predictions according to top N value. For top N = 1 (default) this is equivalent to
  the number of correct predictions
  @return Number of correct top N predictions