concrete.ml.sklearn.tree_to_numpy
Implements the conversion of a tree model to a numpy function.
MAX_BITWIDTH_BACKWARD_COMPATIBLE
OPSET_VERSION_FOR_ONNX_EXPORT
EXPECTED_NUMBER_OF_OUTPUTS_PER_TASK
tree_to_numpy
Convert the tree inference to a numpy functions using Hummingbird.
Args:
model
(onnx.ModelProto): The model to convert.
x
(numpy.ndarray): The input data.
framework
(str): The framework from which the onnx_model is generated.
(options
: 'xgboost', 'sklearn')
task
(Task): The task the model is solving
output_n_bits
(int): The number of bits of the output.
Returns:
Tuple[Callable, List[QuantizedArray], onnx.ModelProto]
: A tuple with a function that takes a numpy array and returns a numpy array, QuantizedArray object to quantize and dequantize the output of the tree, and the ONNX model.
Task
Task enumerate.