_node
Node
⚓︎
Node object for building a decision tree.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
feature |
int index, optional
|
index of the best feature for splitting this Node, by default None |
None
|
threshold |
float, optional
|
the threshold for the best split of the data, by default None |
None
|
left |
Node, optional
|
the left child of this Node also of class Node, by default None |
None
|
right |
Node, optional
|
the right child of this Node also of class Node, by default None |
None
|
majority_class |
int, optional
|
The majority class in this node, only if this Node is a leaf, by default None |
None
|
class_probs |
1d ndarray, optional
|
An array of class probabilities for this node, only if this Node is a leaf, by default None |
None
|
Source code in mlproject/decision_tree/_node.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
is_leaf()
⚓︎
Returns True if this Node is a leaf node, otherwise False
Returns:
Type | Description |
---|---|
bool
|
True if this Node is a leaf node, otherwise False |
Source code in mlproject/decision_tree/_node.py
39 40 41 42 43 44 45 46 47 48 |
|