New! Use Simple ML for Sheets to apply machine learning to the data in your Google Sheets
Read More
tfdf.py_tree.node.AbstractNode
Stay organized with collections
Save and categorize content based on your preferences.
A decision tree node.
Methods
pretty
View source
@abc.abstractmethod
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
View source
scan_structure(
conditions: tfdf.py_tree.node.ScanStructureAccumulator
)
Extracts the condition values and default evaluations.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tfdf.py_tree.node.AbstractNode\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/decision-forests/blob/main/tensorflow_decision_forests/component/py_tree/node.py#L130-L165) |\n\nA decision tree node.\n\nMethods\n-------\n\n### `pretty`\n\n[View source](https://github.com/tensorflow/decision-forests/blob/main/tensorflow_decision_forests/component/py_tree/node.py#L138-L161) \n\n @abc.abstractmethod\n pretty(\n prefix: str, is_pos: Optional[bool], depth: int, max_depth: Optional[int]\n ) -\u003e str\n\nReturns a recursive readable textual representation of a node.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|-------------|----------------------------------------------------------------------------------|\n| `prefix` | Prefix printed on the left side. Used to print the surrounding edges. |\n| `is_pos` | True/False if the node is a positive/negative child. None if the node is a root. |\n| `depth` | Depth of the node in the tree. There is no assuption of on the depth of a root. |\n| `max_depth` | Maximum depth for representation. Deeper nodes are skipped. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| A pretty-string representing the node and its children. ||\n\n\u003cbr /\u003e\n\n### `scan_structure`\n\n[View source](https://github.com/tensorflow/decision-forests/blob/main/tensorflow_decision_forests/component/py_tree/node.py#L134-L136) \n\n scan_structure(\n conditions: ../../../tfdf/py_tree/node/ScanStructureAccumulator\n )\n\nExtracts the condition values and default evaluations."]]