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 classification #3234

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

ewan0x79
Copy link
Contributor

@ewan0x79 ewan0x79 commented Jun 3, 2024

Description

#3223

This PR introduces an enhancement to the LightGBM inference functionality, specifically targeting multi-classification tasks. It modifies the inferenceMat method to dynamically allocate output buffer size based on the number of classes in the model, thus enabling support for multi-class predictions.

Key Changes:

  • The method now retrieves the number of classes in the model using LGBM_BoosterGetNumClasses and allocates the output buffer (outBuffer) accordingly. This ensures that the buffer size is sufficient for storing prediction results for all classes.
  • This change is backward compatible as it extends the existing functionality without altering the method signature or expected input/output types. It enhances the method's capability to handle multi-classification tasks, which was previously not explicitly supported.

@zachgk zachgk merged commit c17307b into deepjavalibrary:master Jun 4, 2024
5 checks passed
@zachgk zachgk linked an issue Jun 4, 2024 that may be closed by this pull request
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.

Does Lightgbm support multi-class inference?
3 participants