srowen commented on a change in pull request #26413: [SPARK-16872][ML][PYSPARK] 
Impl Gaussian Naive Bayes Classifier
URL: https://github.com/apache/spark/pull/26413#discussion_r344248284
 
 

 ##########
 File path: 
mllib/src/main/scala/org/apache/spark/ml/classification/NaiveBayes.scala
 ##########
 @@ -379,14 +518,24 @@ object NaiveBayesModel extends 
MLReadable[NaiveBayesModel] {
   private[NaiveBayesModel] class NaiveBayesModelWriter(instance: 
NaiveBayesModel) extends MLWriter {
 
     private case class Data(pi: Vector, theta: Matrix)
+    private case class GaussianData(pi: Vector, theta: Matrix, sigma: Matrix)
 
     override protected def saveImpl(path: String): Unit = {
       // Save metadata and Params
       DefaultParamsWriter.saveMetadata(instance, path, sc)
-      // Save model data: pi, theta
-      val data = Data(instance.pi, instance.theta)
       val dataPath = new Path(path, "data").toString
-      
sparkSession.createDataFrame(Seq(data)).repartition(1).write.parquet(dataPath)
+
+      if (instance.getModelType != NaiveBayes.Gaussian) {
 
 Review comment:
   Maybe just match on this value instead of if-else?

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