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

test that lightgbm objective is set correctly when label is a factor #43

Merged
merged 1 commit into from
Jul 26, 2022
Merged

test that lightgbm objective is set correctly when label is a factor #43

merged 1 commit into from
Jul 26, 2022

Conversation

jameslamb
Copy link
Contributor

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.

image

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!

@simonpcouch
Copy link
Contributor

This looks great, thank you!

@simonpcouch simonpcouch merged commit 6c090e1 into tidymodels:main Jul 26, 2022
@jameslamb jameslamb deleted the lightgbm-objective-tests branch July 26, 2022 13:29
@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants