The inputs to the alternating decision tree algorithm are: • A set of inputs (x_1,y_1),\ldots,(x_m,y_m) where x_i is a vector of attributes and y_i is either -1 or 1. Inputs are also called instances. • A set of weights w_i corresponding to each instance. The fundamental element of the ADTree algorithm is the rule. A single rule consists of a precondition, a condition, and two scores. A condition is a predicate of the form "attribute value." A precondition is simply a
logical conjunction of conditions. Evaluation of a rule involves a pair of nested if statements: 1
if (precondition) 2
if (condition) 3
return score_one 4
else 5
return score_two 6
end if 7
else 8
return 0 9
end if Several auxiliary functions are also required by the algorithm: • W_+(c) returns the sum of the weights of all positively labeled examples that satisfy predicate c • W_-(c) returns the sum of the weights of all negatively labeled examples that satisfy predicate c • W(c) = W_+(c) + W_-(c) returns the sum of the weights of all examples that satisfy predicate c The algorithm is as follows: 1
function ad_tree 2
input Set of training instances 3 4 for all 5 {{nowrap|1=a = \frac 1 2 \textrm{ln}\frac{W_+(true)}{W_-(true)}}} 6 a rule with scores and , precondition "true" and condition "true." 7 {{nowrap|1=\mathcal{P} = \{true\} }} 8 {{nowrap|1=\mathcal{C} = the set of all possible conditions}} 9 10 {{nowrap|1=p \in \mathcal{P}, c \in \mathcal{C} get values}} {{nowrap|1=that minimize z = 2 \left( \sqrt{W_+(p \wedge c) W_-(p \wedge c)} + \sqrt{W_+(p \wedge \neg c) W_-(p \wedge \neg c)} \right) +W(\neg p) }} 11 {{nowrap|1=\mathcal{P} += p \wedge c + p \wedge \neg c}} 12 {{nowrap|1=a_1=\frac{1}{2}\textrm{ln}\frac{W_+(p\wedge c)+1}{W_-(p \wedge c)+1}}} 13 {{nowrap|1=a_2=\frac{1}{2}\textrm{ln}\frac{W_+(p\wedge \neg c)+1}{W_-(p \wedge \neg c)+1}}} 14 new rule with precondition , condition , and weights and 15 {{nowrap|1=w_i = w_i e^{ -y_i R_j(x_i) }}} 16
end for 17
return set of The set \mathcal{P} grows by two preconditions in each iteration, and it is possible to derive the tree structure of a set of rules by making note of the precondition that is used in each successive rule. ==Empirical results==