\begin{figure}
\begin{alltt}
function Training(data)
  if(isPure(data))
    exit
  
  for(attribute in data)
    for(value in data)
      subset = data given attribute and value
      score = InfoGain(subset)
      rules.push(attribute, value, score)
      
  newRule = maxScore(rules)
  newRule.true = Training(data given newRule.attribute == newRule.value)
  newRule.false = Training(data given newRule.attribute != newRule.value)
  
function Testing(data)
  for(row in data)
    results += GetClassification(row, ruleTree)
    
  return results
  
function GetClassification(row, rule)
  if(rule.isLeaf())
    return rule.classification
    
  if(rule.matches(row))
    return GetClassification(row, rule.true)
  else
    return GetClassification(row, rule.false)
\end{alltt}
\caption{Pseudo code of Ripple Down Rules(RIDOR)}\label{fig:pseudoCode-ridor}
\end{figure}
