amanomer commented on a change in pull request #26758: [SPARK-30124][MLLIB] 
unnecessary persist in PythonMLLibAPI.scala
URL: https://github.com/apache/spark/pull/26758#discussion_r353907947
 
 

 ##########
 File path: 
mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala
 ##########
 @@ -408,7 +408,7 @@ private[python] class PythonMLLibAPI extends Serializable {
     if (seed != null) gmmAlg.setSeed(seed)
 
     try {
-      new 
GaussianMixtureModelWrapper(gmmAlg.run(data.rdd.persist(StorageLevel.MEMORY_AND_DISK)))
+      new GaussianMixtureModelWrapper(gmmAlg.run(data.rdd))
 
 Review comment:
   But I think, it's unnecessary to persist the same rdd twice?
   - First time, it is getting persisted here.
   - Second time, it is persisted (cached) as below.
   
https://github.com/apache/spark/blob/710ddab39e20f49e917311c3e27d142b5a2bcc71/mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixture.scala#L167-L171

----------------------------------------------------------------
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]

Reply via email to