LightGBM icon indicating copy to clipboard operation
LightGBM copied to clipboard

[R-package] expose start_iteration to dump/save/lgb.model.dt.tree

Open mayer79 opened this issue 1 year ago • 1 comments

mayer79 avatar Apr 01 '24 12:04 mayer79

@jameslamb Increadible review, thank you so much for your dedication!

Some comments:

  1. Now, the user sees 1-based start_iteration. The conversion to 0-based is done before calling the R wrappers of the C_API. We could also move the 0-basing into the R wrappers.
  2. The new argument start_iteration has moved to the end of all argument lists, also those of the R wrappers of the C++ code.
  3. I have left the weak unit test of $save_model_to_string() because I don't know how to parse the content of the string.
  4. Also the unit test of lgb.save() is untouched because serializing and deserializing loses the tree index. At least I have this in mind from when I tried to improve the test. Maybe you have a good idea how to make this better?

mayer79 avatar Apr 23 '24 17:04 mayer79

Thanks so much!

Thanks for working with me on the unit tests. I'm really happy that this PR is going to add so much better coverage of an under-tested part of the library.

I left one more set of small suggestions, and then I think this is ready to merge 🎉

Perfect! Should we reformulate the docstrings of all affected functions?

mayer79 avatar May 12 '24 14:05 mayer79

yes please

jameslamb avatar May 12 '24 16:05 jameslamb

yes please

done.

mayer79 avatar May 12 '24 19:05 mayer79