New! Use Simple ML for Sheets to apply machine learning to the data in your Google Sheets
Read More
tfdf.py_tree.node.NonLeafNode
Stay organized with collections
Save and categorize content based on your preferences.
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.
Attributes |
condition
|
The binary condition of the node.
|
pos_child
|
The child to visit when the condition is true.
|
neg_child
|
The child to visit when the condition is false.
|
value
|
The value/prediction/output of the node if it was a leaf. Not used
during prediction.
|
Methods
pretty
View source
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
)
Scans the structure of the tree.
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.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-04-26 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]]