-
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
[python][scikit-learn] Support for multiple evaluation metrics #3165
Conversation
@gramirezespinoza can you merge the latest master branch to pass CI? |
@gramirezespinoza Can you please clarify the intent of this PR? Is it a refactoring? Because all points listed in the starting comment for this PR, like multiple custom metrics and the mix of custom and built-in metrics, are already supported in LightGBM. |
hey @StrikerRUS, @guolinke thanks for having a look at the PR! The idea of the PR is to have total flexibility on the number and types of metrics that the user can monitor during training. To the best of my knowledge, the functionality on this PR is not yet implemented. Happy to answer more questions if needed. All details LightGBM/python-package/lightgbm/sklearn.py Lines 785 to 798 in 1e2013a
with the fix the following line works as expected (see tests in PR):
The second, is added functionality to allow mix of "string" metrics and custom metrics in the sklearn API. Now, it is possible to do this (see tests in PR):
where Finally, the
For any other examples, please see the tests in the PR. |
done |
@gramirezespinoza OK, seems I got it! This PR is a bug fix for
and a refactoring for better usage of mix of custom and built-in metrics in one parameter (namely, Will it make sense to split this PR into two? |
@StrikerRUS sure will split this into two PRs |
Bugfix of LGBMClassifier in this PR |
Second part of this PR implemented in 3254. Closing this PR. |
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. |
This PR:
The
training
andcv
APIs allow the use of multiple LGBM's evaluation metrics defined here but allow only one custom evaluation function. With this changes the user will be able to monitor multiple custom evaluation functions.A similar situation happens in the scikit-learn API. The
eval_metric
parameter in thefit
function accepts a list of LGBM's evaluation metrics or one callable. With these changes the user will be able to monitor multiple LGBM's evaluation metrics, custom metrics, or a mix of both.