public Double getMutualInformation() {
    Double mi = 0.0;
    for (String class_x : getClassNames()) {
      for (String class_y : getClassNames()) {
        try {
          if (getNumClassInstances(class_x) > 0 && getNumClassifiedAs(class_y) > 0 &&
              getInstances(class_x, class_y) > 0) {
            Double p_xy = getInstances(class_x, class_y) / getNumInstances();
            Double p_x = getNumClassInstances(class_x).doubleValue() / getNumInstances();
            Double p_y = getNumClassifiedAs(class_y).doubleValue() / getNumInstances();
            mi += p_xy * Math.log(p_xy / (p_x * p_y));
          }
        } catch (AuToBIException e) {
          AuToBIUtils.error("FATAL ERROR: EvaluationResult has become internally inconsistent.");
          return 0.0;
        }
      }
    }
    return mi;
  }