yobx.sklearn.tree (ExtraTree)#

yobx.sklearn.tree.extra_tree.sklearn_extra_tree_classifier(g: GraphBuilderExtendedProtocol, sts: Dict, outputs: List[str], estimator: ExtraTreeClassifier, X: str, name: str = 'extra_tree_classifier') Tuple[str, str][source]#

Converts a sklearn.tree.ExtraTreeClassifier into ONNX.

sklearn.tree.ExtraTreeClassifier is a single randomised tree that inherits from sklearn.tree.DecisionTreeClassifier and shares the same tree_ attribute layout. This converter therefore delegates to the same helpers used by sklearn_decision_tree_classifier().

When ai.onnx.ml opset 5 (or later) is active in the graph builder the unified TreeEnsemble operator is used; otherwise the legacy TreeEnsembleClassifier operator is emitted.

Parameters:
  • g – the graph builder to add nodes to

  • sts – shapes defined by scikit-learn

  • estimator – a fitted ExtraTreeClassifier

  • outputs – desired names (label, probabilities)

  • X – input tensor name

  • name – prefix names for the added nodes

Returns:

tuple (label_result_name, proba_result_name)

yobx.sklearn.tree.extra_tree.sklearn_extra_tree_regressor(g: GraphBuilderExtendedProtocol, sts: Dict, outputs: List[str], estimator: ExtraTreeRegressor, X: str, name: str = 'extra_tree_regressor') str[source]#

Converts a sklearn.tree.ExtraTreeRegressor into ONNX.

sklearn.tree.ExtraTreeRegressor is a single randomised tree that inherits from sklearn.tree.DecisionTreeRegressor and shares the same tree_ attribute layout. This converter therefore delegates to the same helpers used by sklearn_decision_tree_regressor().

When ai.onnx.ml opset 5 (or later) is active in the graph builder the unified TreeEnsemble operator is used; otherwise the legacy TreeEnsembleRegressor operator is emitted.

When the input tensor is double (float64), a Cast node is appended after the tree operator to ensure the output dtype matches the input dtype.

Parameters:
  • g – the graph builder to add nodes to

  • sts – shapes defined by scikit-learn

  • estimator – a fitted ExtraTreeRegressor

  • outputs – desired output names (predictions)

  • X – input tensor name

  • name – prefix names for the added nodes

Returns:

output tensor name