To do so, the program performs th following steps:
- Load the data from a file
- Calculate occurrences of each attribute value
- Calculate probabilities of each attribute value
- Calculate entropy of each attribute
- Calculate gain ratio of each attribute
- Choose the attribute with the highest gain ratio
- Split the dataset into subsets based on the chosen attribute
- Repeat steps 2-7 for each subset
- Print the decision tree
old,yes,swr,down
old,no,swr,down
old,no,hwr,down
mid,yes,swr,down
mid,yes,hwr,down
mid,no,hwr,up
mid,no,swr,up
new,yes,swr,up
new,no,hwr,up
new,no,swr,up
Atrybut: 1
old -> D: down
mid -> Atrybut: 2
yes -> D: down
no -> D: up
new -> D: up