Using NaiveBayes() function that does not have the right criteria

Hi Dr. Ballings,

For a certain assignment, You want us to find the probability of Churn with Medium Tenure, High Spend.
Manually doing the problem, I got an answer.

*BUT When I was using the naiveBayes() to check my work, I can't find a row that has an instance that satisfies the Medium Tenure, High
Spend criteria (see below)

How are we suppose to use the naiveBayes() command to check our work, if there is not "Medium Tenure, High Spend" criteria instance?

churn tenure spend
1 0 long high
2 0 long high
3 1 short high
4 1 medium medium
5 1 medium low
6 0 medium low
7 1 short low
8 0 long medium
9 1 long low
10 1 medium medium
11 1 long medium
12 1 short medium
13 1 short high
14 0 medium medium

Please advise.


Answers and follow-up questions

Answer or follow-up question 1

Dear Jian,

You can simply use naiveBayes() on the data you have, and then create a new data frame with one row ('Medium Tenure, High Spend") and use
predict() on that.

Watch out if you're using factors (see the naiveBayes code Section).

Michel Ballings

Sign in to be able to add an answer or mark this question as resolved.