[python] make log_evaluation callback pickleable#5101
Conversation
jameslamb
left a comment
There was a problem hiding this comment.
Looks great! Thanks very much for starting work on this issue, I think it'll be great to have better compatibility with frameworks like Ray and Dask.
I just left two minor comments.
| def __init__(self, period: int = 1, show_stdv: bool = True) -> None: | ||
| self.order = 10 | ||
| self.before_iteration = False | ||
|
|
There was a problem hiding this comment.
very very minor comment, but could this empty line be removed, to group all assignments to self.* properties?
There was a problem hiding this comment.
I believe it would be better for code readability to split properties that are common for all callbacks (order and before_iteration) and specific properties for a particular callback. WDYT?
Refer to
LightGBM/python-package/lightgbm/callback.py
Lines 204 to 210 in 417c732
There was a problem hiding this comment.
ah I see, that makes sense. Ok yeah I'm fine with that too! I don't feel strongly either way.
|
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. |
Contributes to #5080.
In
master,test_log_evaluation_callback_is_picklable()test fails with