Skip to main content
. 2020 Aug 17;20(16):4607. doi: 10.3390/s20164607
Algorithm 1. Training Decision Tree
Input: dataset D
Output: the decision tree
1. Initialize an empty tree
2. Generate processed training dataset Dtrain
3. repeat
4. For each attribute aD
5. Compute the gain_ratio of a
6. End
7. choose the best split attribute asp 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 asp
10. for each subdatasets Di
11. Repeat same operation from 3 to 12.
12. End
13. until Di is pure or size of Di less than minimum or the algorithm reaches enough iterations
14. return T.