\input{figures/pseudo-code/oner.tex}
OneR\cite{OneR}, also referred to as 1R, creates a single rule for each attribute value. These rules state that for attribute $A$ and value $V$, the majority class is $C$. After all rules are created, the rule with the highest accuracy on the training dataset is applied to hypotheses $H$. Any ties are chosen at random. Before creating a rule, any continuous attributes are discretized. Next, all rules in hypothesis $H$ are checked for accuracy. Any rule that has an accuracy below that of just choosing the majority class are pruned from $H$. The final set of rules are then sorted by their accuracy on the training set.

OneR is the simplest rule based classifier explored. Each rule tests on just one attribute/value pair, and each rule is analyzed once and discarded. This method of rule testing means that the first group of rules is very important, and, without a patching mechanism in place, can cause a single bad rule choice to lower the classification accuracy. This learner is included as the ``straw man'' of the rule based classifiers.
