Classification Trees Class¶
This is the TPZ.Ctree class in some detail, refer to the source code for mode information and methods.
Module author: Matias Carrasco Kind
- class TPZ.Ctree(X, Y, minleaf=4, forest='yes', mstar=2, dict_dim='', impurity='entropy', nclass=array([0, 1]))¶
Creates a classification tree class instance
Parameters: - X (float or int array, 1 row per object) – Preprocessed attributes array (all columns are considered)
- Y (int array) – Attribute to be predicted
- minleaf (int, def = 4) – Minimum number of objects on terminal leaf
- forest (str, ‘yes’/’no’) – Random forest key
- mstar (int) – Number of random subsample of attributes if forest is used
- impurity – ‘entropy’/’gini’/’classE’ to compute information gain
- nclass (int array) – classes array (labels)
- dict_dim (dict) – dictionary with attributes names
- get_branch(line)¶
Same as Rtree.get_branch()
- get_vals(line)¶
Same as Rtree.get_vals()
- leaves()¶
Same as Rtree.leaves()
- leaves_dim()¶
Same as Rtree.leaves_dim()
- plot_tree(itn=-1, fileout='TPZ', path='', save_png='no')¶
Same as Rtree.plot_tree()
- print_branch(branch)¶
Same as Rtree.print_branch()
- save_tree(itn=-1, fileout='TPZ', path='')¶
Same as Rtree.save_tree()