TreeEnsembleClassifier - version 1#

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

  • Domain: ai.onnx.ml

  • Since version: 1

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.

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].

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).

Examples#

test_cc_treeensembleclassifier_int64_binary

Node:
  ai.onnx.ml.TreeEnsembleClassifier(x) -> (y, z)
  Attributes:
    nodes_treeids = [0, 0, 0]
    nodes_nodeids = [0, 1, 2]
    nodes_featureids = [0, 0, 0]
    nodes_values = [0.5, 0.0, 0.0]
    nodes_modes = ['BRANCH_LEQ', 'LEAF', 'LEAF']
    nodes_truenodeids = [1, 0, 0]
    nodes_falsenodeids = [2, 0, 0]
    class_treeids = [0, 0]
    class_nodeids = [1, 2]
    class_ids = [0, 1]
    class_weights = [1.0, 1.0]
    classlabels_int64s = [0, 1]
    post_transform = "NONE"
Inputs:
  x: shape=(2, 1), dtype=float32
    [[0.],
     [1.]]

Outputs:
  y: shape=(2,), dtype=int64
    [0, 1]
  z: shape=(2, 2), dtype=float32
    [[1., 0.],
     [0., 1.]]