microsoft / microsoft/onnxruntime

ONNX XGBoost classifier gives very different results from the original model

Open
#11,892 3 comments 0 reactions 1 assignee View on GitHub

@xadupre is already working on this.

Since Jun 21, 2022.

Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 8h
Merged PRs (30d)
179

Description

Describe the bug

I am converting a simple XGBoost model to ONNX format. However, the results of the ONNX model mismatch the original model, yielding way worse performance.

Urgency

Quite urgent. This bug can cause harm if people deploy their XGBoost model in ONNX format without noticing this error.

System information

  • MacOS 12.4 or Google Colab
  • ONNX Runtime installed from (source or binary): binary
  • ONNX Runtime version: 1.11.1
  • Python version: 3.7.10

To Reproduce

  1. Train an XGBoost classifier on the Adult dataset
  2. Covert the XGBoost model to ONNX using convert_xgboost
  3. Inference ONNX model using InferenceSession

This bug is reproduced in this Colab notebook

Expected behavior

I expect the results of the ONNX model to match the original XGBoost model.

Screenshots

See this Colab notebook

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.