MCPcopy Create free account
hub / github.com/AssemblyAI-Community/Machine-Learning-From-Scratch / Node

Class Node

04 Decision Trees/DecisionTree.py:4–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2from collections import Counter
3
4class Node:
5 def __init__(self, feature=None, threshold=None, left=None, right=None,*,value=None):
6 self.feature = feature
7 self.threshold = threshold
8 self.left = left
9 self.right = right
10 self.value = value
11
12 def is_leaf_node(self):
13 return self.value is not None
14
15
16class DecisionTree:

Callers 1

_grow_treeMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected