I have two features which are both continuous. How to perform a classification task based on them? I've read the Wikipedia entry on Naive Bayes, but this is only for discrete outcome and one feature.
Asked
Active
Viewed 1,770 times
4
1 Answers
1
I think I've found the solution in the same page. It might because I was dumb or being stressed :).
Example:
$$ \text{posterior}(\text{male})=\frac{P(\text{male})P(\text{height}\mid\text{male})P(\text{weight}\mid\text{male})P(\text{footsize}\mid\text{male})}{\text{evidence}} $$
Thanks @ConjugatePrior.
-
3Glad to hear it now makes sense. btw you don't have to post the image - you can write it in latex math notation, e.g. Bayes theorem is written
p(C|F) = \frac{p(F|C) p(C)}{p(F)}which when you surround it with$signs renders automatically as $p(C|F) = \frac{p(F|C) p(C)}{p(F)}$. – conjugateprior Mar 25 '12 at 08:04 -
@fkr so, concluding from your answer your actual question was how to perform NB with more than one feature ? I ask because your answer does not aim at the special case of continuous features ;). Some have problems calculating the conditional probabilities for cont. features, so I thought your question aims in the same direction. – steffen Mar 25 '12 at 10:15
-
@steffen Actually, I need simply two numerical features and a class of nominal :). – fikr4n Mar 25 '12 at 11:46
-
To point out a nuance about BornToCode's answer, the expression he wrote for the probability of a class is not technically correct. For continuous features such as height, the conditional probability of a single value is always 0. Fortunately, we can use the height of the conditional probability density function corresponding to the value of height as a proxy for the conditional probability of that value occurring. See this question for more details. – Ashkon Farhangi Apr 21 '15 at 15:31
P(C).P(F1|C).P(F2|C)rather thanP(C).P(F|C)? – fikr4n Mar 25 '12 at 02:36