I'm reading up on naive Bayes' classifiers, and it's just an application of Bayes' theorem. Which makes sense in a discrete space; example: counting the number of apples versus oranges, and predicting the probability of the next fruit being an orange given the previous counts and the fact that it's red: P(apple|red) = P(apples)*p(red|apple)/P(red)
But what about if I'm predicting something based on a measurement? Like, instead of red, I check its weight. For any weight, P(weight) = 0, since it's a real number right? How do I work around that?
In general, you're interested in the posterior distribution of apple given weight.
For shorthand, defining $ A := \text{fruit is apple} $ and $ W := \text{weight} $, we have
$$ P(A \mid W) = \frac{P(W \mid A)P(A)}{P(W)} $$
where in this case, $ P(W) $ denotes the marginal density function of weight across all fruits, and $ P(W \mid A) $ is the distribution of weight of fruit conditioned on the fruit being an apple. $ P(A) $ is as usual, the probability that the fruit is an apple.
Then, you can simply evaluate this function at whether $A $ is an apple or orange, and use your estimated marginal density for $ W $ and estimated conditional density for $ W \mid A $.
Estimating these densities is another question entirely!