yunfengzhou-hub commented on code in PR #166:
URL: https://github.com/apache/flink-ml/pull/166#discussion_r1013518990
##########
flink-ml-core/src/main/java/org/apache/flink/ml/param/DoubleParam.java:
##########
@@ -32,4 +34,12 @@ public DoubleParam(
public DoubleParam(String name, String description, Double defaultValue) {
this(name, description, defaultValue, ParamValidators.alwaysTrue());
}
+
+ @Override
+ public Double jsonDecode(Object json) throws IOException {
+ if (json instanceof String && json.equals(String.valueOf(Double.NaN)))
{
+ return Double.NaN;
+ }
+ return (Double) json;
Review Comment:
Other special values include `Double.POSITIVE_INFINITY/NEGATIVE_INFINITY`.
These special values might be used in algorithms like Bucketizer.
I agree with it that we should also update `FloatParam`, as well as
`DoubleArrayParam`, `FloatArrayParam` and `DoubleArrayArrayParam`.
--
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]