The ID3: This is a project that grows a decision tree with ID3 algorithm. It contains,
- A method to read the input data to a 2-dimentional array. The rows are the tuples and the columns are the attributes.
- A function to calculate the entropy of each attributes.
- A method to classify with attributes with “0” or “1”.
- A method to split the data according to the classification of each attributes.
- A function to calculate the information gain after the data is divided into two parts.
- A function to grow the tree with ID3 algorithm to maximum the information gain after each splitting.
- Some tree properties such as counting the internal nodes, counting the leaf nodes to do statistics.
- A test function to test the accuracy of each prediction.
- A method to print the tree.
- A function to prone the decision tree to improve accuracy.
The Random: This is based on the ID3 decision tree. It is added
- a random function to generate a new decision tree and its print function
- another function to calculate the average depth.