zhipeng93 commented on a change in pull request #28:
URL: https://github.com/apache/flink-ml/pull/28#discussion_r757248185



##########
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:
       Having separate classess for different termination conditions is fine 
for me and also may not confuse users. Then we are going to have the following 
three classes:
   - `TerminateOnMaxIterationNum`
   - `TerminateOnToleranceThreshold`
   - `TerminateOnMaxIterationNumOrToleranceThreshold
   
   Do you think it is a viable solution?

##########
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:
       Having separate classess for different termination conditions is fine 
for me and also may not confuse users. Then we are going to have the following 
three classes:
   - `TerminateOnMaxIterationNum`
   - `TerminateOnToleranceThreshold`
   - `TerminateOnMaxIterationNumOrToleranceThreshold`
   
   Do you think it is a viable solution?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to