class ClassificationEvaluationUtil implements Serializable {

    public static Tuple3<Double, Boolean, Double> getBinaryDetailStatistics(Row row,
                                                                            Object[] tuple,
                                                                            TypeInformation labelType) {
        Preconditions.checkArgument(tuple.length == 2, "Label length is not 2, Only support binary evaluation!");
        if (EvaluationUtil.checkRowFieldNotNull(row)) {
            TreeMap<Object, Double> labelProbMap = EvaluationUtil.extractLabelProbMap(row, labelType);
            Object label = row.getField(0);
            Preconditions.checkState(labelProbMap.size() == BINARY_LABEL_NUMBER,
                "The number of labels must be equal to 2!");
            double logLoss = EvaluationUtil.extractLogloss(labelProbMap, label);

            double d = labelProbMap.get(tuple[0]);
            if (label.equals(tuple[0])) {
                return Tuple3.of(d, true, logLoss);
            } else if (label.equals(tuple[1])) {
                return Tuple3.of(d, false, logLoss);
            }
        }
        return null;
    }

}