-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Support exporting cut values #9356
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a feature request?
No. I'm looking into enabling inference libraries to use the quantization result to compress the model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. (I only reviewed the Python portion)
Currently, Treelite performs unique
operation to get the cut values from thresholds. This functionality will be useful, as we can skip the unique
operation.
@hcho3 Please note that this PR doesn't work with approx, which changes cut value for each iteration |
One will have to get the value for every iteration. Currently, this has to be done through some hacks. |
For now, Treelite can continue to scan the thresholds manually to compute the smallest integer width that will fit all thresholds. |
Deviating from the rest of the API functions, the value is returned as a json array interface. The choice is optional, but I want to start the discussion of this choice as we will return more complicated arrays in the future including CUDA arrays.
src
for accessingHistogramCuts
.Downstream projects can use the information to compress the tree model if needed.