0

I'd like to understand if I can and if it's valid approach to train your MNB model with SGD. My application is text classification. In sklearn I've found out that there is no MNB available, and by default it's SVM, however NB is the linear model, isn't it?

So if my likelihood parameters (with Laplacian smoothing) can be estimated as MNB likelihood param estimation

Can I update my parameters with SGD and minimize the cost function?

enter image description here

Please let me know if SGD is irrelevant here. Thanks in advance.

UPDATE: So I got the answer and hope that I got it right, that MNB's parameters are updated by the word occurence in the given input text (like tf-idf). But I still don't understand clearly why we can't use SGD for MNB training. I'd understand it if it's explained in explicit description or with some mathematical interpretation. Thanks

Novitoll
  • 820
  • 1
  • 9
  • 22

1 Answers1

0

In sklearn I've found out that there is no MNB available

Multinomial naive Bayes is implemented in scikit-learn. There is no gradient descent to use. This implementation just uses relative frequencies counts (with smoothing) to find the parameters of the model in a single pass (which the standard and most efficient way to fit an MNB model):

http://scikit-learn.org/stable/modules/naive_bayes.html

ogrisel
  • 39,309
  • 12
  • 116
  • 125
  • Thanks. Yes, I meant "there is no MNB available" for SGDClassifier module, where SGD uses SVM by default. So I thought that we can train our any model with SGD, because it minimizes the cost function.. with gradients. – Novitoll Nov 28 '16 at 14:47