So here is my situation: I have the following dataset and I try for example to find the conditional probability that a person x is Sex=f, Weight=l, Height=t and Long Hair=y.
When I calculate this by hand, the probability is 0.0333. But when I try to predict it from R, I get a different number.
library(naivebayes)
train <- read.csv2("c:/....csv")
classifier <- naive_bayes(Sex ~ .,train)
classifier
> test <- data.frame(Height=c("t"), Weight=c("l"), Long.Hair=c("y"))
> test$Height <- factor(test$Height, levels=c("m","s","t"))
> test$Weight <- factor(test$Weight, levels=c("n","l","h"))
> test$Long.Hair <- factor(test$Long.Hair, levels=c("y","n"))
> test
Height Weight Long.Hair
1 t l y
> prediction <- predict(classifier, test ,type="prob")
> prediction
f m
[1,] 0.9881423 0.01185771
Is there a way that I can find the one that I get by hand?