Cheap and Secure Web Hosting Provider : See Now

[Answers] Simple majority classifier question

, , No Comments
Problem Detail: 

one of my training questions for my exam is the following one:

Suppose you are testing a new algorithm on a data set consisting of 100 positive and 100 negative examples. You plan to use leave-one-out cross-validation (i.e. 200-fold cross-validation) and compare your algorithm to a baseline function, a simple majority classifier. Given a set of training data, the majority classifier always outputs the class that is in the majority in the training set, regardless of the input. You expect the majority classifier to achieve about 50% classification accuracy, but to your surprise, it scores zero every time. Why?

My only solution about it is that the training data is inverse to the real data. But I'm not sure about my answer. May anybody help me?

Regards,

Patrick

Asked By : user3560087

Answered By : Martin Thoma

You have 100 examples of the positive class and 100 examples of the negative class.

Now you do:

examples = "List of all 200 examples" accuracies = Empty list for(i=0; i<|examples|; i++) {     one = examples[i]     training = examples \ {one}      # !!!!!!!!!!!!!!!!!!!!!!!!!     majority_clf = get majority in training. This is the other class than the class of "one"     # !!!!!!!!!!!!!!!!!!!!!!      accuracies.append(majority_clf.predict(one) == class(one)) } overall_accuracy = sum(accuracies) / |accuracies| 
Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/60964

3.2K people like this

 Download Related Notes/Documents

0 comments:

Post a Comment

Let us know your responses and feedback