|
Algorithm 1. Training Decision Tree |
|
Input: dataset
|
|
Output: the decision tree
|
| 1. Initialize an empty tree |
| 2. Generate processed training dataset
|
| 3. repeat |
| 4. For each attribute
|
| 5. Compute the gain_ratio of
|
| 6. End |
| 7. choose the best split attribute based above computed criteria |
| 8. create a decision node and attach this node to the corresponding branch of the tree T |
| 9. partition the dataset to subdatasets based on
|
| 10. for each subdatasets
|
| 11. Repeat same operation from 3 to 12. |
| 12. End |
| 13. until is pure or size of less than minimum or the algorithm reaches enough iterations |
| 14. return . |