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.ExtraTreeClassifierinto ONNX.sklearn.tree.ExtraTreeClassifieris a single randomised tree that inherits fromsklearn.tree.DecisionTreeClassifierand shares the sametree_attribute layout. This converter therefore delegates to the same helpers used bysklearn_decision_tree_classifier().When
ai.onnx.mlopset 5 (or later) is active in the graph builder the unifiedTreeEnsembleoperator is used; otherwise the legacyTreeEnsembleClassifieroperator is emitted.- Parameters:
g – the graph builder to add nodes to
sts – shapes defined by scikit-learn
estimator – a fitted
ExtraTreeClassifieroutputs – 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.ExtraTreeRegressorinto ONNX.sklearn.tree.ExtraTreeRegressoris a single randomised tree that inherits fromsklearn.tree.DecisionTreeRegressorand shares the sametree_attribute layout. This converter therefore delegates to the same helpers used bysklearn_decision_tree_regressor().When
ai.onnx.mlopset 5 (or later) is active in the graph builder the unifiedTreeEnsembleoperator is used; otherwise the legacyTreeEnsembleRegressoroperator is emitted.When the input tensor is double (
float64), aCastnode 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
ExtraTreeRegressoroutputs – desired output names (predictions)
X – input tensor name
name – prefix names for the added nodes
- Returns:
output tensor name