lindong28 commented on a change in pull request #28: URL: https://github.com/apache/flink-ml/pull/28#discussion_r757245219
########## File path: flink-ml-lib/src/main/java/org/apache/flink/ml/clustering/kmeans/KMeans.java ########## @@ -146,7 +145,7 @@ public IterationBodyResult process( DataStream<DenseVector> points = dataStreams.get(0); DataStream<Integer> terminationCriteria = - centroids.flatMap(new TerminateOnMaxIterationNum<>(maxIterationNum)); + centroids.map(x -> 0.).flatMap(new TerminationCriteria(maxIterationNum)); Review comment: IMO, for users who wants to termination iteration based on round number, asking them to map input to double-typed values seems unnecessary and might confuse users. And if we have two separate classes such as `TerminateOnMaxIterationNum ` and `TerminateOnToleranceThreshold`, given that users already have concepts of these two types of termination pattern, the class names seem to be pretty self-explanatory and intuitive. What do you think? Or maybe we can wait for @gaoyunhaii comment? -- 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