4

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.

chl
  • 50,972
  • 18
  • 205
  • 364
fikr4n
  • 151
  • 4

1 Answers1

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.

chl
  • 50,972
  • 18
  • 205
  • 364
fikr4n
  • 151
  • 4
  • 3
    Glad 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. – mlwida 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](http://stats.stackexchange.com/questions/136577/how-to-deal-with-mixture-of-continuous-and-discrete-features-when-using-naive-ba/147535#147535) for more details. – Ashkon Farhangi Apr 21 '15 at 15:31