srowen commented on a change in pull request #26575: [SPARK-29942][ML] Impl 
Complement Naive Bayes Classifier
URL: https://github.com/apache/spark/pull/26575#discussion_r347426209
 
 

 ##########
 File path: python/pyspark/ml/classification.py
 ##########
 @@ -1909,6 +1909,11 @@ class NaiveBayes(JavaProbabilisticClassifier, 
_NaiveBayesParams, HasThresholds,
     binary (0/1) data, it can also be used as `Bernoulli NB
     
<http://nlp.stanford.edu/IR-book/html/htmledition/the-bernoulli-model-1.html>`_.
     The input feature values for Multinomial NB and Bernoulli NB must be 
nonnegative.
+    Since 3.0.0, it supports Complement NB which is an adaptation of the 
Multinomial NB.
+    Specifically, Complement NB uses statistics from the complement of each 
class to compute
+    the model's coefficients. The inventors of Complement NB show empirically 
that the parameter
+    estimates for CNB are more stable than those for Multinomial NB. Like 
Multinomial NB, the
+    input feature values for Complement NB must be nonnegative.
 
 Review comment:
   Does this need any additional doc changes in Pyspark to show the new type 
that's allowed, or a doctest example?

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