concrete.ml.sklearn.tree_to_numpy
module concrete.ml.sklearn.tree_to_numpy
concrete.ml.sklearn.tree_to_numpyImplements the conversion of a tree model to a numpy function.
Global Variables
MAXIMUM_TLU_BIT_WIDTH
OPSET_VERSION_FOR_ONNX_EXPORT
EXPECTED_NUMBER_OF_OUTPUTS_PER_TASK
function tree_to_numpy
tree_to_numpytree_to_numpy(
model: ModelProto,
x: ndarray,
framework: str,
task: Task,
output_n_bits: Optional[int] = 16
) → Tuple[Callable, List[UniformQuantizer], ModelProto]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 solvingoutput_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.
class Task
TaskTask enumerate.
Last updated
Was this helpful?