Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/7672#discussion_r35732493
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/classification/NaiveBayes.scala ---
@@ -129,29 +129,49 @@ class NaiveBayesModel private[ml] (
throw new UnknownError(s"Invalid modelType: ${$(modelType)}.")
}
- override protected def predict(features: Vector): Double = {
+ override val numClasses: Int = pi.size
+
+ private def posteriorProbabilities(logProb: DenseVector) = {
--- End diff --
For this, multinomialCalculation, and bernoulliCalculation, can you just
use the versions of the code from spark.mllib? It looks like they can be made
static easily by passing model parameters as needed. That will reduce code
duplication.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]