About the learning parameteres in Naive Bayes

well i am little bit confused in Naive Bayes

In naive baye’s algorithm where doest the training takes place i mean we do not learn any parameters like we do in linear regression through training of the model so when we apply Multinomial Naive Bayes throught sklearn library why we train our data by passing training data??

Yes @amankharb, you are absolutely right that no parameters are learnt in Naive Bayes algorithm.
Instead, when training on the dataset, we can pre-compute the probability of each class and the probability of each class given different input (x) values. No coefficients need to be fitted by optimization procedures but pre-computing the required probabilities can speed up the inference/prediction step.

Hope this helps!

well everytime when we send xtest with n features to predict its category so the algorithm have to perform all the calculations so how can we pre compute the probability of each class given different input x only we can pre compute the probability of the class labels only

That depends on the dataset. e.g. For GaussianNB, we can precompute the mean and variances of features which would help us evaluate P(Xi / Ck) for a query efficiently.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.