yunfengzhou-hub commented on code in PR #131:
URL: https://github.com/apache/flink-ml/pull/131#discussion_r925083352
##########
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:
Given that we are making this a public method, I think it might be better to
make it more generic to be useful in other algorithms as well. For example,
instead of just validating integer arrays, we can make it validate any numeric
arrays. Or we can introduce a `forEach` method, so that in order to validate
indices, we can use `ParamValidators.forEach(ParamValidators.gtEq(0))`. What do
you think of these ideas? we can discuss offline about this topic.
--
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]