View source on GitHub |
A non-leaf node i.e.
Inherits From: AbstractNode
tfdf.py_tree.node.NonLeafNode(
condition: tfdf.py_tree.condition.AbstractCondition
,
pos_child: Optional[tfdf.py_tree.node.AbstractNode
] = None,
neg_child: Optional[tfdf.py_tree.node.AbstractNode
] = None,
value: Optional[tfdf.py_tree.node.AbstractValue
] = None
)
a node containing a split/condition.
Methods
pretty
pretty(
prefix: str, is_pos: Optional[bool], depth: int, max_depth: Optional[int]
) -> str
Returns a recursive readable textual representation of a node.
Args | |
---|---|
prefix
|
Prefix printed on the left side. Used to print the surrounding edges. |
is_pos
|
True/False if the node is a positive/negative child. None if the node is a root. |
depth
|
Depth of the node in the tree. There is no assuption of on the depth of a root. |
max_depth
|
Maximum depth for representation. Deeper nodes are skipped. |
Returns | |
---|---|
A pretty-string representing the node and its children. |
scan_structure
scan_structure(
conditions: tfdf.py_tree.node.ScanStructureAccumulator
)
Scans the structure of the tree.