Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TreeEnsemble base values for the reference implementation #5665

Merged
merged 10 commits into from Oct 18, 2023

Conversation

xadupre
Copy link
Contributor

@xadupre xadupre commented Oct 13, 2023

This PR fixes one line failing on #5569. What follows comes from this PR description.

Description

In the reference implementation of TreeEnsembleRegressor when a value is provided for the base_values argument, this value replaces any prediction. This can't be what's intended and does not match onnxruntime. Instead, the base_value should be added to the prediction after applying any aggregation.

Motivation and Context

We are exporting regression trees into ONNX that have a non-zero base_value as the baseline prediction for the tree. Prediction works as expected in onnxruntime but not in the reference implementation. I believe this is an oversight and propose the fix (plus tests) below. I also think the documentation should be more explicit about what the base_values argument does.

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

All modified lines are covered by tests ✅

Files Coverage Δ
...ference/ops/aionnxml/op_tree_ensemble_regressor.py 90.24% <100.00%> (+4.87%) ⬆️
onnx/test/reference_evaluator_ml_test.py 93.98% <100.00%> (+0.04%) ⬆️

📢 Thoughts on this report? Let us know!.

@corwinjoy
Copy link
Contributor

Thanks for this! Reviewing the changes, this update looks good to me.

@justinchuby justinchuby marked this pull request as ready for review October 14, 2023 03:39
@justinchuby justinchuby requested review from a team as code owners October 14, 2023 03:39
@xadupre xadupre changed the title [WIP] investigate, TreeEnsemble base values for the reference implementation TreeEnsemble base values for the reference implementation Oct 16, 2023
@justinchuby justinchuby added the review needed: operators approvers Require reviews from members of operators-approvers label Oct 16, 2023
@xadupre xadupre added this pull request to the merge queue Oct 18, 2023
@justinchuby justinchuby removed the review needed: operators approvers Require reviews from members of operators-approvers label Oct 18, 2023
Merged via the queue into onnx:main with commit 8fd6971 Oct 18, 2023
37 checks passed
@xadupre xadupre deleted the basev branch October 18, 2023 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants