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

adding sparse support to TreeSHAP in lightgbm #3000

Merged
merged 12 commits into from
Jun 28, 2020

Conversation

imatiach-msft
Copy link
Contributor

@imatiach-msft imatiach-msft commented Apr 16, 2020

Adding sparse support to TreeSHAP algorithm in lightgbm. The feature importances for a sparse matrix should be returned as a sparse matrix as well. This should improve both performance and memory usage for very sparse datasets.

Unlike other predict APIs, it's not as easy to figure out prior to prediction what the size will be of the sparse matrix result, so we allocate the data on the native-side and expose an additional API to deallocate the sparse matrix arrays.

include/LightGBM/c_api.h Outdated Show resolved Hide resolved
include/LightGBM/c_api.h Show resolved Hide resolved
@imatiach-msft imatiach-msft force-pushed the ilmat/feature-imp-sparse branch 2 times, most recently from 39e14fc to 44f9bf9 Compare April 24, 2020 21:45
@guolinke
Copy link
Collaborator

@imatiach-msft ping me when this is ready to review.

@imatiach-msft imatiach-msft force-pushed the ilmat/feature-imp-sparse branch from 44f9bf9 to 166dd64 Compare April 28, 2020 21:37
@imatiach-msft imatiach-msft force-pushed the ilmat/feature-imp-sparse branch 2 times, most recently from b8a932b to 6f7439d Compare April 30, 2020 02:59
@imatiach-msft imatiach-msft force-pushed the ilmat/feature-imp-sparse branch 6 times, most recently from b6c6af1 to 3f9760b Compare April 30, 2020 21:44
@imatiach-msft imatiach-msft changed the title [WIP] adding sparse support to TreeSHAP in lightgbm adding sparse support to TreeSHAP in lightgbm Apr 30, 2020
@imatiach-msft
Copy link
Contributor Author

@guolinke thank you, pinging as this PR is ready for review, also tagging @slundberg for review

@imatiach-msft imatiach-msft force-pushed the ilmat/feature-imp-sparse branch 4 times, most recently from 4041429 to 9d37bb9 Compare May 1, 2020 21:53
@jameslamb
Copy link
Collaborator

@jameslamb for some reason I still see "GitHub Actions / r-package (windows-latest, MINGW, R 3.6) (pull_request) " builds fail

I will look once they rebuild. Sorry, they are still new and GitHub Actions is also still a bit rough to work with.

@jameslamb
Copy link
Collaborator

@imatiach-msft I see the two Windows R4.0 builds are now failing. From the logs, I don't think it's a result of this PR. Will try to reproduce tonight and get it resolved quickly.

@StrikerRUS
Copy link
Collaborator

@jameslamb FYI, there are a lot of PRs failing with these GitHub Actions jobs (R 4). master is also failing. Network issues again?..

@jameslamb
Copy link
Collaborator

@jameslamb FYI, there are a lot of PRs failing with these GitHub Actions jobs (R 4). master is also failing. Network issues again?..

gah! They don't look like networking issues, but I'm not sure. Investigating in #3191

@jameslamb
Copy link
Collaborator

Ok @imatiach-msft now that we've merged #3193 , I think if you merge that into this branch the R CI jobs will be working

@imatiach-msft imatiach-msft force-pushed the ilmat/feature-imp-sparse branch from 92801a2 to 777ac74 Compare June 28, 2020 03:04
@imatiach-msft
Copy link
Contributor Author

@jameslamb done, thanks!

@imatiach-msft
Copy link
Contributor Author

close-reopen for CI, getting ".ci/test.sh: line 150: pytest: command not found"

@jameslamb
Copy link
Collaborator

close-reopen for CI, getting ".ci/test.sh: line 150: pytest: command not found"

which job had that failure? Could you share a link?

@StrikerRUS StrikerRUS merged commit 9f367d1 into microsoft:master Jun 28, 2020
@imatiach-msft
Copy link
Contributor Author

great to see this merged, thank you for the great reviews!

@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 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants