onnx / sklearn-onnx

Convert scikit-learn models and pipelines to ONNX
Apache License 2.0
538 stars 99 forks source link

Unused argument: custom_parsers #1119

Open Fred51 opened 1 month ago

Fred51 commented 1 month ago

Hello there,

I was trying to see how I would write a custom parser to make it so that a model converted from xgboost classifier could only return probabilities, not the standard label and dictionary of probabilities. I eventually realized it didn't matter what I passed to custom_parsers in convert_sklearn, it returned the same output.

Diving into the code I noticed that, unless I'm missing something, this custom_parsers argument is unused in the parse_sklearn_simple_function.

Is there intention to make use of this parameter? Should it be removed or perhaps an error thrown that custom parsers are currently unsupported?

https://github.com/onnx/sklearn-onnx/blob/99939ef5653ba709716787c934871c33f9557c23/skl2onnx/_parse.py#L104

xadupre commented 1 month ago

You can read this example to see how to define your own parser: https://onnx.ai/sklearn-onnx/auto_tutorial/plot_mcustom_parser.html.