# Using Naïve Bayes to predict disease occurence

I have a dataset concerning patients with information about their diseases and symptoms. I want to estimate probability of $P(disease_i = TRUE|symptom_j = TRUE)$. My intuition is that I should use a Naïve Bayes classifier, but every example I've found applies Naïve Bayes when there's only one disease (like predicting the probability of heart attack).

My data looks like this:

patient | disease | if_disease_present | symptom

1       | d1      | TRUE               | s1
2       | d1      | FALSE              | s2
3       | d2      | TRUE               | s1
4       | d3      | TRUE               | s4
5       | d4      | FALSE              | s8
...


My idea was to split data according to diseases and build the number of naive Bayesian models how many unique diseases I have in my data, but I have doubts if it's proper method.

UPDATE: Assume that I want to predict probability $P(X|Y)$. It's clear for me how to use R's implementation of Naïve Bayes when my $X$ is for example cancer/not cancer or a/b/c/d (or like here where $X$ is binary).

My difficult is "how to estimate $P(X|Y)$ when $X$ is more "complex". In my data I would like to predict conditional probability of some diseases (let's say number d3) when this disease is present under some symptom; because I have also rows with patients who were tested if they suffer from d3 but for whom the value of if_disease_present for d3 is $FALSE$.

FURTHER UPDATE: I would like to consider the presence/absence of all unique diseases in ONE model. Every patient could be connected with more than one disease and could have it or not.

The short answer is yes, Naive Bayes can predict many different classes (A vs B vs C vs ...), and is not limited to just two classes ("disease" vs "no disease"). What you're describing is a multinomial Naive Bayes classifier.

I suppose that I should use NB classifier

Why not SVM or random forest? There are lots of different classifiers, with advantages and disadvantages for different data and needs. If you provide more information about what you're doing we can comment on which, if any, are best for your case.

If that's all you want, why not just calculate $P(X|Y)$? A Naive Bayes classifier compares probabilities and selects the most probable class. If you're interested in guessing classes, i.e. classifying, there are ways to do it that don't explicitly calculate $P(X|Y)$.