\begin{figure}[t]\label{fig:pseudoCode-training}
\begin{alltt}
\scriptsize
function Training(data)
  if(numRows == 0 || depth >= 15)
    exit;
  
  for(row in data) 
    for(column in columns) 
      columnWidth = \(\frac{max(column) - min(column)}{3}\)
      row[column].value = \(\frac{row[column].value - min(column)}{columnWidth}\)
  

  choices = GetColumnWeights(data)
  
  maxChoice = max(choices);

  rule = CreateRule(maxChoice, data)
  
  return rule
  rule.true = Training(data | rule)
  rule.false = Training(data | !rule)


function CreateRule(choice, data)
  rule.function = choice
  rule.true = Training(data | choice)
  rule.false = Training(data | !choice)
  return rule


function GetColumnWeights(data)
  for(column in columns)
    for(bin in column)
      trueData = data | column.value = bin && data.class = true
      falseData = data | column.value = bin && data.class = false
      column.bin.weight = max(\(\frac{trueData.size}{data | data.class = true}\), -
\(\frac{falseData.size}{data | data.class = false}\))
\end{alltt}
\caption{Pseudo code of the Clump Training process}
\end{figure}

\begin{figure}[t]\label{fig:pseudoCode-testing}
\begin{alltt}
\scriptsize
function Testing(data)
  chunks = split(data)
  for(chunk in chunks set)
    for(row in chunk)
      gatheredData += GatherData(tree, row)

  nb = NaiveBayes(gatheredData)
  return nb(data)
\end{alltt}
\caption{Pseudo code of the Clump Testing process}
\end{figure}
