id3 Module
Implements the ID3 decision tree algorithm.
@author: drusk
-
pml.supervised.decision_trees.id3.build_tree(dataset)[source]
Builds the decision tree for a data set using the ID3 algorithm.
- Args:
- dataset: model.DataSet
- The data for which the decision tree will be built.
- Return:
- tree: Tree
- The decision tree that was built.
-
pml.supervised.decision_trees.id3.choose_feature_to_split(dataset)[source]
Choose the root to be the feature which has the highest information
gain.
- Args:
- dataset: model.DataSet
- The data set being used to build the decision tree.
- Returns:
- feature: string
- The feature which should be the root.