TreeEnsembleClassifier - version 3#

This page documents version 3 of operator TreeEnsembleClassifier. See TreeEnsembleClassifier for the latest version (since version 5).

  • Domain: ai.onnx.ml

  • Since version: 3

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 _as_tensor can be used instead of the same parameter without the suffix if the element type is double and not float.

Inputs

  • X (T1): Input of shape [N,F]

Outputs

  • Y (T2): N, Top class for each point

  • Z (tensor(float)): The class score for each class, for each point, a tensor of shape [N,E].

Attributes

  • base_values (float[]): Base values for classification, added to final class score.

  • base_values_as_tensor (tensor): Base values for classification, added to final class score.

  • class_ids (int[]): The index of the class list that each weight is for.

  • class_nodeids (int[]): node id that this weight is for.

  • class_treeids (int[]): The id of the tree that this node is in.

  • class_weights (float[]): The weight for the class in class_id.

  • class_weights_as_tensor (tensor): The weight for the class in class_id.

  • classlabels_int64s (int[]): Class labels if using integer labels. One and only one of the ‘classlabels*’ attributes must be defined.

  • classlabels_strings (string[]): Class labels if using string labels. One and only one of the ‘classlabels*’ attributes must be defined.

  • nodes_falsenodeids (int[]): Child node if expression is false.

  • nodes_featureids (int[]): Feature id for each node.

  • nodes_hitrates (float[]): Popularity of each node, used for performance and may be omitted.

  • nodes_hitrates_as_tensor (tensor): Popularity of each node, used for performance and may be omitted.

  • nodes_missing_value_tracks_true (int[]): For each node, define what to do in the presence of a missing value.

  • nodes_modes (string[]): The node kind, that is, the comparison to make at the node.

  • nodes_nodeids (int[]): Node id for each node. Ids may restart at zero for each tree.

  • nodes_treeids (int[]): Tree id for each node.

  • nodes_truenodeids (int[]): Child node if expression is true.

  • nodes_values (float[]): Thresholds to do the splitting on for each node.

  • nodes_values_as_tensor (tensor): Thresholds to do the splitting on for each node.

  • post_transform (string): Indicates the transform to apply to the score.

Type Constraints

  • T1: The input type must be a tensor of a numeric type. Allowed types: tensor(double), tensor(float), tensor(int32), tensor(int64).

  • T2: The output type will be a tensor of strings or integers, depending on which of the classlabels* attributes is used. Allowed types: tensor(int64), tensor(string).

Differences with previous version (1)#

SchemaDiff: TreeEnsembleClassifier (domain 'ai.onnx.ml')

  • old version: 1

  • new version: 3

  • breaking: no

Attributes:

  • added ‘nodes_values_as_tensor’: type=TENSOR; required=False; default=UNDEFINED

  • added ‘nodes_hitrates_as_tensor’: type=TENSOR; required=False; default=UNDEFINED

  • added ‘class_weights_as_tensor’: type=TENSOR; required=False; default=UNDEFINED

  • added ‘base_values_as_tensor’: type=TENSOR; required=False; default=UNDEFINED

Documentation:

  • line similarity: 0.82 (+3/-1 lines)

--- TreeEnsembleClassifier v1
+++ TreeEnsembleClassifier v3
@@ -1,5 +1,5 @@

-    Tree Ensemble classifier.  Returns the top class for each of N inputs.<br>
+    Tree Ensemble classifier. Returns the top class for each of N inputs.<br>
     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.<br>
@@ -8,3 +8,5 @@
     the associated class_weights index.<br>
     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.