return (correct - chanceAgreement) / (1 - chanceAgreement);
if (chanceAgreement < 1) { return (correct - chanceAgreement) / (1 - chanceAgreement); } else { return 1; }
  public final double kappa() {        double[] sumRows = new double[m_ConfusionMatrix.length];    double[] sumColumns = new double[m_ConfusionMatrix.length];    double sumOfWeights = 0;    for (int i = 0; i < m_ConfusionMatrix.length; i++) {      for (int j = 0; j < m_ConfusionMatrix.length; j++) {	sumRows[i] += m_ConfusionMatrix[i][j];	sumColumns[j] += m_ConfusionMatrix[i][j];	sumOfWeights += m_ConfusionMatrix[i][j];      }    }    double correct = 0, chanceAgreement = 0;    for (int i = 0; i < m_ConfusionMatrix.length; i++) {      chanceAgreement += (sumRows[i] * sumColumns[i]);      correct += m_ConfusionMatrix[i][i];    }    chanceAgreement /= (sumOfWeights * sumOfWeights);    correct /= sumOfWeights;    return (correct - chanceAgreement) / (1 - chanceAgreement);  }