Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class node():
- def __init__(self):
- self.split_atrr = None
- self.split_thres = None
- self.left_child = None
- self.right_child = None
- def get_name(self):
- return 'Node'
- class leaf():
- def __init__(self):
- self.label = None
- def get_nmae(self):
- return 'leaf'
- class decision_tree():
- def __init__(self):
- self.root = None
- def fit(self, x, y):
- self.spliter(x,y,self.root)
- return 0
- def spliter(self,x,y,tree)
- tree = node() #this does not make self.root as a node
- spliter(x,y,tree.left_child) #this line does not work unless I change the __init__ to "self.root = node()"
- # Wish to recursively expand the tree.
- #However, return error saying tree.left_child is none type
Add Comment
Please, Sign In to add comment