zhipeng93 commented on code in PR #252:
URL: https://github.com/apache/flink-ml/pull/252#discussion_r1303854514


##########
flink-ml-lib/src/test/java/org/apache/flink/ml/evaluation/BinaryClassificationEvaluatorTest.java:
##########
@@ -297,14 +298,20 @@ public void testEvaluateWithMultiScore() {
     public void testEvaluateWithWeight() {
         BinaryClassificationEvaluator eval =
                 new BinaryClassificationEvaluator()
-                        
.setMetricsNames(BinaryClassificationEvaluatorParams.AREA_UNDER_ROC)
+                        .setMetricsNames(
+                                
BinaryClassificationEvaluatorParams.AREA_UNDER_ROC,
+                                
BinaryClassificationEvaluatorParams.AREA_UNDER_PR)
                         .setWeightCol("weight");
         Table evalResult = eval.transform(inputDataTableWithWeight)[0];
-        List<Row> results = 
IteratorUtils.toList(evalResult.execute().collect());
+        Row result = (Row) 
IteratorUtils.toList(evalResult.execute().collect()).get(0);
         assertArrayEquals(
-                new String[] 
{BinaryClassificationEvaluatorParams.AREA_UNDER_ROC},
+                new String[] {
+                    BinaryClassificationEvaluatorParams.AREA_UNDER_ROC,
+                    BinaryClassificationEvaluatorParams.AREA_UNDER_PR
+                },
                 evalResult.getResolvedSchema().getColumnNames().toArray());
-        assertEquals(EXPECTED_DATA_W, results.get(0).getFieldAs(0), EPS);
+        assertArrayEquals(
+                EXPECTED_DATA_W, new double[] {result.getFieldAs(0), 
result.getFieldAs(1)}, 1e-9);

Review Comment:
   nit: Let's use `EPS` instead of `1e-9` for consistency with existing tests?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to