Accuracy of classifiers is often compared to the "default accuracy", that is, the accuracy of a classifier which classifies all examples to the majority class. To fit into the standard schema, even this algorithm is provided in form of the usual learner-classifier pair. Learning is done by orange.
and the classifier it construct is an instance of orange.
.
MajorityLearner
will most often be used as is, without setting any features. Nevertheless, it has two.
Attributes
None
, probability of each class is estimated as the relative frequency of examples belonging to this class.DefaultClassifier
always classifies to the same class and reports same class probabilities.
Attributes
The DefaultClassifier
's constructor can be called without arguments, with value (for defaultVal
), variable (for classVar
). If the value is given and is of type orange.Value
(alternatives are an integer index of a discrete value or a continuous value), its field variable
is will either be used for initializing classVar
if variable is not given as an argument, or checked against the variable argument, if it is given.
This "learning algorithm" will most often be used to establish whether some other learning algorithm is better than "nothing". Here's a simple example.
majority.py (uses monk1.tab)