lindong28 commented on code in PR #219:
URL: https://github.com/apache/flink-ml/pull/219#discussion_r1136518106


##########
flink-ml-lib/src/test/java/org/apache/flink/ml/classification/LogisticRegressionTest.java:
##########
@@ -253,6 +255,25 @@ public void testSaveLoadAndPredict() throws Exception {
                 logisticRegression.getRawPredictionCol());
     }
 
+    @Test
+    public void testSaveLoadServable() throws Exception {
+        LogisticRegression logisticRegression = new 
LogisticRegression().setWeightCol("weight");
+        LogisticRegressionModel model = 
logisticRegression.fit(binomialDataTable);
+
+        LogisticRegressionModelServable servable =
+                saveAndLoadServable(
+                        tEnv,
+                        model,
+                        tempFolder.newFolder().getAbsolutePath(),
+                        LogisticRegressionModel::loadServable);
+
+        assertEquals("features", servable.getFeaturesCol());
+        assertEquals("prediction", servable.getPredictionCol());
+        assertEquals("rawPrediction", servable.getRawPredictionCol());
+
+        assertArrayEquals(expectedCoefficient, 
servable.getCoefficient().values, 0.1);

Review Comment:
   `LogisticRegressionModelServableTest#testTransform` does not save/load 
servable.
   
   We need to have a test that shows that we can save/load servable and use the 
loaded servable for online prediction, similar to why we have both 
`LogisticRegressionTest#testFitAndPredict` and 
`LogisticRegressionTest#testSaveLoadAndPredict`.



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

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

Reply via email to