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
Simple majority classifier question
machine learning;classification
You have 100 examples of the positive class and 100 examples of the negative class.Now you do:examples = List of all 200 examplesaccuracies = Empty listfor(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|