-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
feature importance type in saved model file #3220
Conversation
@guolinke Don't you want to expose this parameter to C API? With 3.0 I guess it's good time to break some code (if any). Then wrappers will be able to provide this param directly in function like start/end iterations LightGBM/python-package/lightgbm/basic.py Lines 2734 to 2750 in 2792923
|
Thanks @StrikerRUS , I change all related functions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that the R unit tests are failing. To get better logs, you can do this:
Rscript build_r.R
cd R-package/tests/
Rscript testthat.R
If you don't have an R environment available easily let me know and I can run that for you.
Co-authored-by: James Lamb <jaylamb20@gmail.com>
…osoft/LightGBM into feature-importance-type-cli
ping @imatiach-msft for swig fix |
@guolinke this looks great! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
b0bea13
to
a275533
Compare
@guolinke In my commit 4f3803d I LightGBM/include/LightGBM/c_api.h Lines 1067 to 1076 in 61b3c30
LightGBM/src/boosting/gbdt_model_text.cpp Line 618 in 61b3c30
added defines in C API for better user experience and changed in Python package param type from int to string for better usage and to unify with existing codebase: LightGBM/python-package/lightgbm/sklearn.py Lines 244 to 247 in 61b3c30
LightGBM/python-package/lightgbm/basic.py Lines 2956 to 2959 in 61b3c30
|
a275533
to
4f3803d
Compare
// desc = **Note**: can be used only in CLI version | ||
int saved_feature_importance_type = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guolinke I added CLI-only
flag. Should it be marked as [no-save]
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, CLI-only
is needed. As for [no-save]
, I think it is better not marked, as user may want to know which feature importance type is saved in the model file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Agree with you!
Fixed #3011. |
Thank you @StrikerRUS for the doc improvement, as always! |
@jameslamb Is something left for R-package? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R side looks good to me! It would be good to have an R test for using gain-based feature importance but I can do that in a later PR
@jameslamb Thank you! I think it's better to have a separate PR for R tests. |
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. |
No description provided.