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 also be the invalid values that need to be replaced 
with Imputer.
   
   I agree with it that we should also update `FloatParam`. By the way, 
algorithms like Bucketizer have been using these special values in their 
parameters, and Flink ML's implementation of  `DoubleArrayParam` has supported 
such special values, so it might be enough just to update `DoubleParam` and 
`FloatParam`.



-- 
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