A MATLAB implementation of the ID3 decision tree building algorithm for classification tasks.
The algorithm was extended to include the handling of numerical attributes, as in the C4.5 evolution of the original ID3 algorithm. However, this implementation does not include features such as a-posteriori pruning.
decision_tree_classifier_main.m
The main script to launch the programclassifier.m
Performs the classification task given a tree representation and a sample to classify. Returns the label predicted for the given sampleconstruct_tree.m
Recursively construct a decision tree classifier based on a given dataset and a set of labelspreprocess_numerical.m
Preprocess a numerical feature to adapt it to the ID3 algorithmget_prob_vect.m
andH.m
are simple utility functions to create probability vectors out of a set of data and to compute the entropy of an array, respectively
Training data and labels should be provided to construct_tree
as a N*m and m sized matrix and array respectively. Labels should be in integer format.
Predicted label is returned as a single integer.