You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/07/20 02:53:03 UTC

[GitHub] [flink-ml] weibozhao commented on a diff in pull request #131: [FLINK-28563] Add Transformer for VectorSlicer

weibozhao commented on code in PR #131:
URL: https://github.com/apache/flink-ml/pull/131#discussion_r925115735


##########
flink-ml-core/src/main/java/org/apache/flink/ml/param/ParamValidators.java:
##########
@@ -38,6 +38,22 @@ public static <T> ParamValidator<T> gtEq(double lowerBound) {
         return (value) -> value != null && ((Number) value).doubleValue() >= lowerBound;
     }
 
+    // Checks if all values in the parameter intArray is greater than or equal to lowerBound.
+    public static <T> ParamValidator<T> intArrayGtEq(double lowerBound) {
+        return value -> {

Review Comment:
   I think making it more generic is better than introducing a forEach function. Introducing a forEach may make the user API more complicated. 
   
   - ParamValidators.numericalArrayGtEq(0))
   - ParamValidators.forEach(ParamValidators.gtEq(0))



-- 
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-unsubscribe@flink.apache.org

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