lindong28 commented on a change in pull request #70:
URL: https://github.com/apache/flink-ml/pull/70#discussion_r834995617
##########
File path:
flink-ml-lib/src/main/java/org/apache/flink/ml/clustering/kmeans/KMeansModelData.java
##########
@@ -47,8 +47,16 @@
public DenseVector[] centroids;
+ public DenseVector weights;
+
+ public KMeansModelData(DenseVector[] centroids, DenseVector weights) {
+ this.centroids = centroids;
+ this.weights = weights;
+ }
+
public KMeansModelData(DenseVector[] centroids) {
this.centroids = centroids;
+ this.weights = new DenseVector(centroids.length);
Review comment:
If this model data is only guaranteed to be used only by
`OnlineKMeansModel`, I agree we can do that.
For the code that constructs a KMeansModelData instance, if it is not
guaranteed that this instance is only used by `OnlineKMeansModel`, I suggested
to still make this model data `self-contained` with valid weights.
--
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]