Naive-Bayes problem?

Cesar

New member
Joined
Apr 11, 2015
Messages
1
Hi, im trying to work some naive bayes problem but I cant seem to get it. so I understand the Naive-bayes concept but my teacher left me this homework:
USe the following information to train your algorithm:
-Numbers from zero to nine
- zero is even

Define the variables that allows to classify if a number is even or odd with naive bayes.

I get the naive-bayes but im struggling trying to come up with the variables, any idea what this variables might be.
 
Hi, im trying to work some naive bayes problem but I cant seem to get it. so I understand the Naive-bayes concept but my teacher left me this homework:
USe the following information to train your algorithm:
-Numbers from zero to nine
- zero is even

Define the variables that allows to classify if a number is even or odd with naive bayes.

I get the naive-bayes but im struggling trying to come up with the variables, any idea what this variables might be.
O.K., let me mumble to myself. The a priory probability [what happened before] is essentially what we are developing when we train the classifier. Although one can (and probably should) use the same algorythm for both training and classifying, it is not necessary. So, if we have an input set along with its classification [the training set], the classifier is supposed to develop the probabilities of each class occurring for the set of a priory probabilities.

Now the actual classifier: It is 'a set of 'rules' developed to provide an output [it could be just one number or a vector of numbers]. That output is then assigned a probability of belonging to a particular class depending on the set of rules output and the a priory probabilities. Typically, the highest probability determines the output class of the input and the probabilities are not really seen [just the 'facts'] but some classifiers also output the complete/partial list of classes and probabilities.

For a simple example, we write a program which will return 0 if there are no prime divisors less than the number or 1 if the number of distinct prime divisors less than the number is more than 0, i.e. 22 would return 1 and 13 would return 0. We use this program to determine whether a number is prime.
First Training: We input 30 numbers with at least, say 5 primes and 5 non-primes along with their classification. During training the program 'counts' the number of times the rule output was 1 and the number was prime, the number of times the rule output was 0 and the number was prime, the number of times the rule output was 1 and the number was composite, the number of times the rule output was 0 and the number was composite in order to develop the a priory probabilities.
Testing: We input numbers to see what the classifier says. If sufficient, it is ready to be introduced to the world. If not, more training and/or better rule development.
 
Top