Skip to content

Instantly share code, notes, and snippets.

@lethalbrains
Created August 8, 2018 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lethalbrains/fd7e554292ff4e2f65fe527e47acc0fe to your computer and use it in GitHub Desktop.
Save lethalbrains/fd7e554292ff4e2f65fe527e47acc0fe to your computer and use it in GitHub Desktop.
def __init__(self, max_depth = 4, depth = 1):
self.max_depth = max_depth
self.depth = depth
self.left = None
self.right = None
def __create_branches(self):
self.left = DecisionTree(max_depth = self.max_depth,
depth = self.depth + 1)
self.right = DecisionTree(max_depth = self.max_depth,
depth = self.depth + 1)
# Rest of code in this method would remain the same.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment