spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkbradley <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-4894][mllib] Added Bernoulli option to ...
Date Tue, 10 Mar 2015 21:42:03 GMT
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4087#discussion_r26169235
  
    --- 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)
    +  extends ClassificationModel with Serializable with Saveable {
    +
    +  def this(labels: Array[Double], pi: Array[Double], theta: Array[Array[Double]]) =
    --- End diff --
    
    I just realized that the old constructor was private[mllib].  We should probably keep
this private[mllib] for now too.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message