Hi, I need a good R code for text classification - based on multinomial bysein network when test and training data are different. Navies byes does not work for text classification. Gives same prior class probability.

# R text classificaton bayesian network

**suhalivyas**#2

Naive Bayes does not give the same prior probability to all the classes, it is actually the count of total occurrences of the said class divided by the total number of entries.

The following link will help you better understand the prior probabilities and other details of the algorithm:

Reply if you need any further help.

**sset**#3

For unseen data (data not present in training set) Navie Byes always returns same value - prior class probability value assume u have 4 classes - return 0.25 (1/4).

please see code/test data posted (you can run and check)

http://discuss.analyticsvidhya.com/t/r-text-navie-byes-same-values-for-class-posterior-probability/6414/4

Can u share code for bysein belief network R text classification for unseen data?

Any other work around for getting unseen word similar to training data (synonym…)

Thanks