\begin{figure}
\begin{alltt}
function Training(data)
  for(attribute in data)
    for(value in attribute)
      rule.push(attribute, value, majorityClass(data given attribute and value)
    rules.push(rule)
      
  for(rule in rules)
    subset = data given rule.attribute == rule.value
    rule.score = frequencyOf(rule.class in subset) / subset.length
    
  return rules for the attribute with the 
  
function Testing(data)
  for(row in data)
    results += row.class == rule.class for row.attributeValue
    
\end{alltt}
\caption{Pseudo code of OneR}\label{fig:pseudoCode-oner}
\end{figure}
