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

remove unused DCGCalculator::CalDCGAtK() #4650

Merged
merged 2 commits into from
Oct 5, 2021
Merged

Conversation

jameslamb
Copy link
Collaborator

cppcheck shows the following warning (#4539 (comment))

src/metric/dcg_calculator.cpp:110:0: style: The function 'CalDCGAtK' is never used. [unusedFunction]

I confirmed that this method is not called anywhere in the library, using git grep CalDCGAtK. I think it's safe to remove, since only the code in src/c_api.cpp is considered parrt of the public API for LightGBM.

I also double-checked and don't see this method referenced in the in-progress CUDA work (#4528, #4630).

Notes for Reviewers

I checked the git blame to see if this method had been added for a specific purpose in the past, but don't see anything like that. It was part of the first commit on the project.

https://github.com/microsoft/LightGBM/blame/e95d5ab849f046b8fdf755441e5767094aeb8de2/src/metric/dcg_calculator.cpp#L56

@shiyu1994
Copy link
Collaborator

@jameslamb Thanks for the careful check. Since we are now evaluating NDCGs at multiple positions at once, only CalDCG is found to be used, instead of CalDCGAtK. I agree that it is safe to remove this.

Copy link
Collaborator

@shiyu1994 shiyu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve given all the checks have been passed.

@StrikerRUS StrikerRUS merged commit df8c10b into master Oct 5, 2021
@StrikerRUS StrikerRUS deleted the cppcheck/unused-calc-dcg branch October 5, 2021 21:17
@jameslamb jameslamb mentioned this pull request Oct 6, 2021
16 tasks
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

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

Successfully merging this pull request may close these issues.

3 participants