onnx / onnxmltools

ONNXMLTools enables conversion of models to ONNX
https://onnx.ai
Apache License 2.0
998 stars 181 forks source link

XGBRegressor with objective='count:poisson' causes serialization to fail with no error message #658

Open ParanoidAltoid opened 12 months ago

ParanoidAltoid commented 12 months ago

http://onnx.ai/sklearn-onnx/auto_examples/plot_pipeline_xgboost.html

Download file found at bottom of page in that link, and run with count:poisson: pipe = Pipeline([("scaler", StandardScaler()), ("xgb", XGBRegressor(n_estimators=3, objective='count:poisson'))]) Comparing results before and after serializing/deserializing: predict [0.9388053 0.9388053 0.9388053 0.9388053 0.9388053] predict [1.13 1.13 1.13 1.13 1.13]

Additional info:

Python 3.10, all versions below are latest from pip, except xgboost which doesn't work at all per https://github.com/onnx/onnxmltools/issues/651#issuecomment-1747861712_

xgboost==1.7.0 skl2onnx==1.15.0 onnx==1.14.1 onnxconverter-common==1.14.0 onnxmltools==1.11.2 onnxruntime==1.16.0

xadupre commented 9 months ago

The latest release version should work with this objective.