yobx.sklearn.preprocessing.binarizer#

yobx.sklearn.preprocessing.binarizer.sklearn_binarizer(g: GraphBuilderExtendedProtocol, sts: Dict, outputs: List[str], estimator: Binarizer, X: str, name: str = 'binarizer') str[source]#

Converts a sklearn.preprocessing.Binarizer into ONNX.

All feature values greater than threshold are set to 1, all others to 0. The mapping follows the sklearn definition (strictly greater):

X  ──Greater(threshold)──►  mask (bool)  ──Cast(dtype)──►  output
Parameters:
  • g – the graph builder to add nodes to

  • sts – shapes defined by scikit-learn

  • estimator – a fitted or unfitted Binarizer

  • outputs – desired output names

  • X – input name

  • name – prefix name for the added nodes

Returns:

output name