Documente Academic
Documente Profesional
Documente Cultură
Leaf nodes are marked as terminal nodes. Internal nodes are non-terminal nodes. Non-
terminal nodes are selected from the function set while the terminal nodes are selected
from the terminal set. An example function and terminal sets are given below:
Normally, tree is generated from the root node and keeps on growing till some specific
depth. Normally, functions and terminal nodes are selected randomly from the function and
terminal sets.
A tree is evaluated and its goodness is calculated against some training data set. An example
training dataset is given below:
In the training set “x” is the independent variable and f(x) is the output or dependent
variable. Performance of a tree is measured for each row by plugging in the value of the
terminal (x) from the data set and comparing its output with f(x). If they match there is zero
error in that row. Similarly, error on each row of the data set is calculated. A fit tree is the
one that has cumulative (error on all the rows) is zero.
1) Discuss the possible application of dynamic programming to find the optimal tree for
the given data set. If it is applicable then prove that the problem has optimal
substructure and overlapping subproblems. In case it is not applicable then give a
justification for this.
2) Can you propose a greedy solution for this problem? Does this problem have greedy
choice property? Give proof in support of your answer.