{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["# Tricky detail when converting a random forest from scikit-learn into ONNX\n", "\n", "*scikit-learn* use a specific comparison when computing the preduction of a decision tree, it does ``(float)x <= threshold`` (see [tree.pyx / method apply_dense](https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_tree.pyx#L796)). *ONNX* does not specify such things and compares *x* to _threshold_, both having the same type. What to do then when writing the converter."]}, {"cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [{"data": {"text/html": ["
\n", ""], "text/plain": ["