Skip to content

Latest commit

 

History

History
 
 

c_CvDTree

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Decision Tree

Implemented ID3, C4.5 & CART. Capable for dealing with relatively 'raw' data

Visualization

ID3

ID3

C4.5

C4.5

CART

CART

Example

from Util.Util import DataUtil
from c_CvDTree.Tree import CartTree

x, y = DataUtil.gen_xor(one_hot=False)  # Get xor dataset. Notice that y should not be one-hot
tree = CartTree()                       # Use Cart Tree for example
tree.fit(x, y, train_only=True)         # Use all dataset for training
tree.view()                             # View trained Cart Tree in console
tree.evaluate(x, y)                     # Print out accuracy 
tree.visualize2d(x, y)                  # Visualize result (2d)
tree.visualize()                        # Visualize Cart Tree itself
tree.show_timing_log()                  # Show timing log