0
$\begingroup$

I need to understand, how multinomial-naive-bayes can make prediction based on scikit-learn implementation. I saw the source code but I want to understand the math behind it. Could you please explain the math behind this prediction?

$\endgroup$

1 Answer 1

0
$\begingroup$

To understand the Naive Bayes ML algorithms, a good start is understanding the original Naive Bayes probability function and what conditional probability implies.

Short answer : In your training data, you can "learn" inferences such as "what is the probability of seeing the word 'money' in spams". You can create a large number of those inferences between your dependent variables (your features) and the class you are trying to predict. Probabilities allow you to combine those inferences (multiplying the probabilities) to make predictions on new data the model has never seen before, allowing to class it in a certain class.

Note : I'll add some links in the comments

$\endgroup$
2
  • $\begingroup$ The youtube channel "Statquest" is a good data/ml channel that goes properly in some math concepts. He has good videos on Naive Bayes. Here's a link : youtube.com/watch?v=O2L2Uv9pdDA $\endgroup$ Mar 22, 2023 at 14:28
  • $\begingroup$ Thanks. I know. I needed to understand how in source code it will be calculated. $\endgroup$ Mar 22, 2023 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.