code: public double fBeta(double beta, EvaluationAveraging averaging) {
          if(getNumRowCounter() == 0.0){
              return Double.NaN;  //No data
          }
          int nClasses = confusion().getClasses().size();
  
          if (nClasses == 2) {
              return EvaluationUtils.fBeta(beta, (long) truePositives.getCount(1), (long) falsePositives.getCount(1),
                              (long) falseNegatives.getCount(1));
          }
  
          if (averaging == EvaluationAveraging.Macro) {
              double macroFBeta = 0.0;
              int count = 0;
              for (int i = 0; i < nClasses; i++) {
                  double thisFBeta = fBeta(beta, i, -1);
                  if (thisFBeta != -1) {
                      macroFBeta += thisFBeta;
                      count++;
                  }
              }
              macroFBeta /= count;
              return macroFBeta;
          } else if (averaging == EvaluationAveraging.Micro) {
              long tpCount = 0;
              long fpCount = 0;
              long fnCount = 0;
              for (int i = 0; i < nClasses; i++) {
                  tpCount += truePositives.getCount(i);
                  fpCount += falsePositives.getCount(i);
                  fnCount += falseNegatives.getCount(i);
              }
              return EvaluationUtils.fBeta(beta, tpCount, fpCount, fnCount);
          } else {
              throw new UnsupportedOperationException("Unknown averaging approach: " + averaging);
          }
      }
docs: Calculate the average F_beta score across all classes, using macro or micro averaging
  
  @param beta Beta value to use
  @param averaging Averaging method to use