Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4087#discussion_r26169233
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala ---
    @@ -35,26 +39,30 @@ import org.apache.spark.sql.{DataFrame, SQLContext}
      * @param pi log of class priors, whose dimension is C, number of labels
      * @param theta log of class conditional probabilities, whose dimension is 
C-by-D,
      *              where D is number of features
    + * @param modelType The type of NB model to fit from the enumeration 
NaiveBayesModels, can be
    + *              Multinomial or Bernoulli
      */
     class NaiveBayesModel private[mllib] (
         val labels: Array[Double],
         val pi: Array[Double],
    -    val theta: Array[Array[Double]]) extends ClassificationModel with 
Serializable with Saveable {
    +    val theta: Array[Array[Double]],
    +    val modelType: String)
    --- End diff --
    
    It might be nice to expose this as the enum-like type instead of a String.  
Does that sound reasonable (since users use it when calling NaiveBayes anyways).
    
    It would be good to avoid using "ModelType.fromString" in the predict() 
method.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to