ai.onnx.ml - TreeEnsembleClassifier#
TreeEnsembleClassifier - 3 (ai.onnx.ml)#
Version
domain: ai.onnx.ml
since_version: 3
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 3 of domain ai.onnx.ml.
Summary
Tree Ensemble classifier. Returns the top class for each of N inputs.
The attributes named ‘nodes_X’ form a sequence of tuples, associated by index into the sequences, which must all be of equal length. These tuples define the nodes.
Similarly, all fields prefixed with ‘class_’ are tuples of votes at the leaves. A leaf may have multiple votes, where each vote is weighted by the associated class_weights index.
One and only one of classlabels_strings or classlabels_int64s will be defined. The class_ids are indices into this list. All fields ending with <i>_as_tensor</i> can be used instead of the same parameter without the suffix if the element type is double and not float.
Attributes
base_values: Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)
base_values_as_tensor: Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)
class_ids: The index of the class list that each weight is for.
class_nodeids: node id that this weight is for.
class_treeids: The id of the tree that this node is in.
class_weights: The weight for the class in class_id.
class_weights_as_tensor: The weight for the class in class_id.
classlabels_int64s: Class labels if using integer labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.
classlabels_strings: Class labels if using string labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.
nodes_falsenodeids: Child node if expression is false.
nodes_featureids: Feature id for each node.
nodes_hitrates: Popularity of each node, used for performance and may be omitted.
nodes_hitrates_as_tensor: Popularity of each node, used for performance and may be omitted.
nodes_missing_value_tracks_true: For each node, define what to do in the presence of a missing value: if a value is missing (NaN), use the ‘true’ or ‘false’ branch based on the value in this array.<br>This attribute may be left undefined, and the defalt value is false (0) for all nodes.
nodes_modes: The node kind, that is, the comparison to make at the node. There is no comparison to make at a leaf node.<br>One of ‘BRANCH_LEQ’, ‘BRANCH_LT’, ‘BRANCH_GTE’, ‘BRANCH_GT’, ‘BRANCH_EQ’, ‘BRANCH_NEQ’, ‘LEAF’
nodes_nodeids: Node id for each node. Ids may restart at zero for each tree, but it not required to.
nodes_treeids: Tree id for each node.
nodes_truenodeids: Child node if expression is true.
nodes_values: Thresholds to do the splitting on for each node.
nodes_values_as_tensor: Thresholds to do the splitting on for each node.
post_transform: Indicates the transform to apply to the score. <br> One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT.’ Default value is
'NONE'
.
Inputs
X (heterogeneous) - T1: Input of shape [N,F]
Outputs
Y (heterogeneous) - T2: N, Top class for each point
Z (heterogeneous) - tensor(float): The class score for each class, for each point, a tensor of shape [N,E].
Type Constraints
T1 in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type.
T2 in ( tensor(int64), tensor(string) ): The output type will be a tensor of strings or integers, depending on which of the the classlabels_* attributes is used.
Examples
Differences
0 | 0 | Tree Ensemble classifier. Returns the top class for each of N inputs. |
|
1 | 1 |
|
|
2 | 2 | The attributes named 'nodes_X' form a sequence of tuples, associated by | The attributes named 'nodes_X' form a sequence of tuples, associated by |
3 | 3 | index into the sequences, which must all be of equal length. These tuples | index into the sequences, which must all be of equal length. These tuples |
4 | 4 | define the nodes. | define the nodes. |
5 | 5 |
|
|
6 | 6 | Similarly, all fields prefixed with 'class_' are tuples of votes at the leaves. | Similarly, all fields prefixed with 'class_' are tuples of votes at the leaves. |
7 | 7 | A leaf may have multiple votes, where each vote is weighted by | A leaf may have multiple votes, where each vote is weighted by |
8 | 8 | the associated class_weights index. | the associated class_weights index. |
9 | 9 |
|
|
10 | 10 | One and only one of classlabels_strings or classlabels_int64s | One and only one of classlabels_strings or classlabels_int64s |
11 | 11 | will be defined. The class_ids are indices into this list. | will be defined. The class_ids are indices into this list. |
12 | All fields ending with _as_tensor can be used instead of the | ||
13 | same parameter without the suffix if the element type is double and not float. | ||
12 | 14 |
|
|
13 | 15 | **Attributes** | **Attributes** |
14 | 16 |
|
|
15 | 17 | * **base_values**: | * **base_values**: |
16 | 18 | Base values for classification, added to final class score; the size | Base values for classification, added to final class score; the size |
17 | 19 | must be the same as the classes or can be left unassigned (assumed | must be the same as the classes or can be left unassigned (assumed |
18 | 20 | 0) | 0) |
21 | * **base_values_as_tensor**: | ||
22 | Base values for classification, added to final class score; the size | ||
23 | must be the same as the classes or can be left unassigned (assumed | ||
24 | 0) | ||
19 | 25 | * **class_ids**: | * **class_ids**: |
20 | 26 | The index of the class list that each weight is for. | The index of the class list that each weight is for. |
21 | 27 | * **class_nodeids**: | * **class_nodeids**: |
22 | 28 | node id that this weight is for. | node id that this weight is for. |
23 | 29 | * **class_treeids**: | * **class_treeids**: |
24 | 30 | The id of the tree that this node is in. | The id of the tree that this node is in. |
25 | 31 | * **class_weights**: | * **class_weights**: |
26 | 32 | The weight for the class in class_id. | The weight for the class in class_id. |
33 | * **class_weights_as_tensor**: | ||
34 | The weight for the class in class_id. | ||
27 | 35 | * **classlabels_int64s**: | * **classlabels_int64s**: |
28 | 36 | Class labels if using integer labels. | Class labels if using integer labels. |
29 | 37 | 'classlabels_*' attributes must be defined. | 'classlabels_*' attributes must be defined. |
30 | 38 | * **classlabels_strings**: | * **classlabels_strings**: |
31 | 39 | Class labels if using string labels. | Class labels if using string labels. |
32 | 40 | 'classlabels_*' attributes must be defined. | 'classlabels_*' attributes must be defined. |
33 | 41 | * **nodes_falsenodeids**: | * **nodes_falsenodeids**: |
34 | 42 | Child node if expression is false. | Child node if expression is false. |
35 | 43 | * **nodes_featureids**: | * **nodes_featureids**: |
36 | 44 | Feature id for each node. | Feature id for each node. |
37 | 45 | * **nodes_hitrates**: | * **nodes_hitrates**: |
38 | 46 | Popularity of each node, used for performance and may be omitted. | Popularity of each node, used for performance and may be omitted. |
47 | * **nodes_hitrates_as_tensor**: | ||
48 | Popularity of each node, used for performance and may be omitted. | ||
39 | 49 | * **nodes_missing_value_tracks_true**: | * **nodes_missing_value_tracks_true**: |
40 | 50 | For each node, define what to do in the presence of a missing value: | For each node, define what to do in the presence of a missing value: |
41 | 51 | if a value is missing (NaN), use the 'true' or 'false' branch based | if a value is missing (NaN), use the 'true' or 'false' branch based |
42 | 52 | on the value in this array. | on the value in this array. |
43 | 53 | and the defalt value is false (0) for all nodes. | and the defalt value is false (0) for all nodes. |
44 | 54 | * **nodes_modes**: | * **nodes_modes**: |
45 | 55 | The node kind, that is, the comparison to make at the node. There is | The node kind, that is, the comparison to make at the node. There is |
46 | 56 | no comparison to make at a leaf node. | no comparison to make at a leaf node. |
47 | 57 | 'BRANCH_LT', 'BRANCH_GTE', 'BRANCH_GT', 'BRANCH_EQ', 'BRANCH_NEQ', | 'BRANCH_LT', 'BRANCH_GTE', 'BRANCH_GT', 'BRANCH_EQ', 'BRANCH_NEQ', |
48 | 58 | 'LEAF' | 'LEAF' |
49 | 59 | * **nodes_nodeids**: | * **nodes_nodeids**: |
50 | 60 | Node id for each node. Ids may restart at zero for each tree, but it | Node id for each node. Ids may restart at zero for each tree, but it |
51 | 61 | not required to. | not required to. |
52 | 62 | * **nodes_treeids**: | * **nodes_treeids**: |
53 | 63 | Tree id for each node. | Tree id for each node. |
54 | 64 | * **nodes_truenodeids**: | * **nodes_truenodeids**: |
55 | 65 | Child node if expression is true. | Child node if expression is true. |
56 | 66 | * **nodes_values**: | * **nodes_values**: |
57 | 67 | Thresholds to do the splitting on for each node. | Thresholds to do the splitting on for each node. |
68 | * **nodes_values_as_tensor**: | ||
69 | Thresholds to do the splitting on for each node. | ||
58 | 70 | * **post_transform**: | * **post_transform**: |
59 | 71 | Indicates the transform to apply to the score. | Indicates the transform to apply to the score. |
60 | 72 | 'SOFTMAX,' 'LOGISTIC,' 'SOFTMAX_ZERO,' or 'PROBIT.' Default value is 'NONE'. | 'SOFTMAX,' 'LOGISTIC,' 'SOFTMAX_ZERO,' or 'PROBIT.' Default value is 'NONE'. |
61 | 73 |
|
|
62 | 74 | **Inputs** | **Inputs** |
63 | 75 |
|
|
64 | 76 | * **X** (heterogeneous) - **T1**: | * **X** (heterogeneous) - **T1**: |
65 | 77 | Input of shape [N,F] | Input of shape [N,F] |
66 | 78 |
|
|
67 | 79 | **Outputs** | **Outputs** |
68 | 80 |
|
|
69 | 81 | * **Y** (heterogeneous) - **T2**: | * **Y** (heterogeneous) - **T2**: |
70 | 82 | N, Top class for each point | N, Top class for each point |
71 | 83 | * **Z** (heterogeneous) - **tensor(float)**: | * **Z** (heterogeneous) - **tensor(float)**: |
72 | 84 | The class score for each class, for each point, a tensor of shape | The class score for each class, for each point, a tensor of shape |
73 | 85 | [N,E]. | [N,E]. |
74 | 86 |
|
|
75 | 87 | **Type Constraints** | **Type Constraints** |
76 | 88 |
|
|
77 | 89 | * **T1** in ( | * **T1** in ( |
78 | 90 | tensor(double), | tensor(double), |
79 | 91 | tensor(float), | tensor(float), |
80 | 92 | tensor(int32), | tensor(int32), |
81 | 93 | tensor(int64) | tensor(int64) |
82 | 94 | ): | ): |
83 | 95 | The input type must be a tensor of a numeric type. | The input type must be a tensor of a numeric type. |
84 | 96 | * **T2** in ( | * **T2** in ( |
85 | 97 | tensor(int64), | tensor(int64), |
86 | 98 | tensor(string) | tensor(string) |
87 | 99 | ): | ): |
88 | 100 | The output type will be a tensor of strings or integers, depending | The output type will be a tensor of strings or integers, depending |
89 | 101 | on which of the the classlabels_* attributes is used. | on which of the the classlabels_* attributes is used. |
TreeEnsembleClassifier - 1 (ai.onnx.ml)#
Version
domain: ai.onnx.ml
since_version: 1
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 1 of domain ai.onnx.ml.
Summary
Tree Ensemble classifier. Returns the top class for each of N inputs.
The attributes named ‘nodes_X’ form a sequence of tuples, associated by index into the sequences, which must all be of equal length. These tuples define the nodes.
Similarly, all fields prefixed with ‘class_’ are tuples of votes at the leaves. A leaf may have multiple votes, where each vote is weighted by the associated class_weights index.
One and only one of classlabels_strings or classlabels_int64s will be defined. The class_ids are indices into this list.
Attributes
base_values: Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)
class_ids: The index of the class list that each weight is for.
class_nodeids: node id that this weight is for.
class_treeids: The id of the tree that this node is in.
class_weights: The weight for the class in class_id.
classlabels_int64s: Class labels if using integer labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.
classlabels_strings: Class labels if using string labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.
nodes_falsenodeids: Child node if expression is false.
nodes_featureids: Feature id for each node.
nodes_hitrates: Popularity of each node, used for performance and may be omitted.
nodes_missing_value_tracks_true: For each node, define what to do in the presence of a missing value: if a value is missing (NaN), use the ‘true’ or ‘false’ branch based on the value in this array.<br>This attribute may be left undefined, and the defalt value is false (0) for all nodes.
nodes_modes: The node kind, that is, the comparison to make at the node. There is no comparison to make at a leaf node.<br>One of ‘BRANCH_LEQ’, ‘BRANCH_LT’, ‘BRANCH_GTE’, ‘BRANCH_GT’, ‘BRANCH_EQ’, ‘BRANCH_NEQ’, ‘LEAF’
nodes_nodeids: Node id for each node. Ids may restart at zero for each tree, but it not required to.
nodes_treeids: Tree id for each node.
nodes_truenodeids: Child node if expression is true.
nodes_values: Thresholds to do the splitting on for each node.
post_transform: Indicates the transform to apply to the score. <br> One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT.’ Default value is
'NONE'
.
Inputs
X (heterogeneous) - T1: Input of shape [N,F]
Outputs
Y (heterogeneous) - T2: N, Top class for each point
Z (heterogeneous) - tensor(float): The class score for each class, for each point, a tensor of shape [N,E].
Type Constraints
T1 in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type.
T2 in ( tensor(int64), tensor(string) ): The output type will be a tensor of strings or integers, depending on which of the the classlabels_* attributes is used.