test that lightgbm objective is set correctly when label is a factor #43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contributes to #34 .
Currently,
{bonsai}
contains some logic for determining the correct classification objective for LightGBM models when the provided label is a factor column.However, that logic is not currently covered by any unit tests.
This PR proposes adding such tests, to improve the ability to catch compatibility issues between
{bonsai}
and{lightgbm}
both evolve.How I tested this
Ran the tests with
{covr}
and generated a clickable coverage report before and after making these changes, with the following.Rscript \ --vanilla \ -e "covr::report(covr::package_coverage(), file = file.path(getwd(), 'coverage.html'))"
Notes for Reviewers
The next release of
{lightgbm}
might include support for data frames and for this sort of "automatically determine the objective for factor labels". Please subscribe to notifications on microsoft/LightGBM#5341 and microsoft/LightGBM#4323, and please add any relevant comments on those issues if you'd like to influence the eventual shape that that support takes.Thanks for your time and consideration!