lindong28 commented on code in PR #219:
URL: https://github.com/apache/flink-ml/pull/219#discussion_r1139907982
##########
flink-ml-lib/src/main/java/org/apache/flink/ml/classification/logisticregression/LogisticRegressionModel.java:
##########
@@ -149,22 +152,14 @@ public Row map(Row dataPoint) {
getRuntimeContext().getBroadcastVariable(broadcastModelKey).get(0);
coefficient = modelData.coefficient;
}
- DenseVector features = ((Vector)
dataPoint.getField(featuresCol)).toDense();
- Row predictionResult = predictOneDataPoint(features, coefficient);
- return Row.join(dataPoint, predictionResult);
- }
- }
+ Vector features = (Vector) dataPoint.getField(featuresCol);
+
+ LogisticRegressionModelServable servable =
+ new LogisticRegressionModelServable(
Review Comment:
Making `LogisticRegressionModelServable(LogisticRegressionModelData) `
protected sounds good to me.
However, asking developers to identify and forward the selectively
parameters from model to servable is not very convenient and introduces chances
of human error. It will much more convenient for Flink ML to provide infra that
algorithm developers can use to forward parameters, similar to how the existing
Estimators forward parameters to Model using `ParamUtils.updateExistingParams`.
--
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]