jiangxin369 commented on code in PR #219:
URL: https://github.com/apache/flink-ml/pull/219#discussion_r1136491018
##########
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:
I don't think we really need to verify the result of the
`servable.transform(...)`, because it has been covered in
`LogisticRegressionModelServableTest#testTransform`. If you are worrying about
the consistency of test cases of `PipelineTest` and
`LogisticRegressionModelServableTest`, I think we should change the
`PipelineTest#testPipelineModelServable` to only verify the model data of each
stages.
--
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]