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

[Lgbm] support multi type prediction #3237

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

ewan0x79
Copy link
Contributor

@ewan0x79 ewan0x79 commented Jun 5, 2024

Description

This PR is primarily aimed at implementing data inference functionality using the LightGBM model, supporting various types of inference including Raw Score, Leaf Index, and Feature Contribution. The inference task is accomplished through JNI calls to the LightGBM C API, and the results are returned in the form of a ByteBuffer for further processing.

  • Backward Incompatible Changes: There are no backward incompatible changes in this update. It mainly introduces new functionalities without altering the behavior of existing features. Therefore, existing code and functionalities should not be affected by this change.
  • Interesting Edge Cases to Note:
    • When the prediction type is Leaf Index, although the LightGBM C API returns the results as floating-point numbers (double), these values are actually integer indices. Therefore, when processing these values, it might be necessary to convert them into integer types.

@ewan0x79 ewan0x79 requested review from zachgk, frankfliu and a team as code owners June 5, 2024 03:56
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 68.51852% with 17 lines in your changes missing coverage. Please review.

Project coverage is 72.41%. Comparing base (bd7f4ca) to head (03e9809).
Report is 3 commits behind head on master.

Files Patch % Lines
...src/main/java/ai/djl/ml/lightgbm/jni/JniUtils.java 48.00% 12 Missing and 1 partial ⚠️
...bm/src/main/java/ai/djl/ml/lightgbm/LgbmModel.java 71.42% 0 Missing and 2 partials ⚠️
.../main/java/ai/djl/ml/lightgbm/LgbmSymbolBlock.java 90.90% 1 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3237      +/-   ##
============================================
+ Coverage     64.26%   72.41%   +8.15%     
- Complexity     6455     7317     +862     
============================================
  Files           676      676              
  Lines         32443    32486      +43     
  Branches       3417     3425       +8     
============================================
+ Hits          20849    23525    +2676     
+ Misses        10016     7346    -2670     
- Partials       1578     1615      +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@frankfliu frankfliu merged commit 6f89664 into deepjavalibrary:master Jun 7, 2024
5 checks passed
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.

3 participants