srowen commented on a change in pull request #27014:
[SPARK-29967][ML][FOLLOWUP] KMeans Cleanup
URL: https://github.com/apache/spark/pull/27014#discussion_r361476598
##########
File path:
mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala
##########
@@ -42,10 +42,10 @@ class KMeansModel (@Since("1.0.0") val clusterCenters:
Array[Vector],
private[spark] val numIter: Int)
extends Saveable with Serializable with PMMLExportable {
- private val distanceMeasureInstance: DistanceMeasure =
+ @transient private lazy val distanceMeasureInstance: DistanceMeasure =
Review comment:
Is the reason that this not serializable? if it's just to not serialize it,
it might not be worth the overhead of lazy, but won't matter much. I can
understand not serializing the cluster centers twice, effectively
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]