Repository navigation
Conversation
position field in Dataset|
Thanks for working on this! Very supportive of this change. I haven't reviewed yet, just a quick note... CI will be blocked until someone can review this PR to fix a couple issues: #7249. Sorry for the delay. |
4fdf64f to
365f7dd
Compare
jameslamb
left a comment
There was a problem hiding this comment.
Thanks for this, at a glance it looks pretty good to me and I support this.
There are some test failures:
FAILED tests/python_package_test/test_basic.py::test_dataset_construction_overwrites_user_provided_metadata_fields - AssertionError:
Arrays are not equal
(dtypes int32, float32 mismatch)
ACTUAL: array([0, 1], dtype=int32)
DESIRED: array([0., 1.], dtype=float32)
FAILED tests/python_package_test/test_engine.py::test_ranking_with_position_information_with_dataset_constructor - AssertionError:
Arrays are not equal
(dtypes int32, int64 mismatch)
ACTUAL: array([0, 1, 2, ..., 1, 3, 9], shape=(3005,), dtype=int32)
DESIRED: array([0, 5, 9, ..., 5, 4, 8], shape=(3005,))
= 2 failed, 1486 passed, 15 skipped, 8 xfailed, 52 xpassed, 3395 warnings in 542.38s (0:09:02) =
Can you please investigate those?
It'll be faster to run these tests locally yourself, which you can do like this:
# build lib_lightgbm (only needs to be re-run for C++ changes)
rm -rf ./build
cmake -B build -S .
cmake --build build --target _lightgbm -j4
# build and install lightgbm Python package
sh build-python.sh --precompile install
# run tests
pytest \
tests/python_package_test/test_basic.py \
tests/python_package_test/test_engine.pyHappy to review more thoroughly once the tests are passing. @ me if you need help.
Oops π They should be passing now! |
8a98de1 to
450f71a
Compare
839db0d to
4f62abb
Compare
597d98b to
a0c01e5
Compare
a0c01e5 to
8909317
Compare
jameslamb
left a comment
There was a problem hiding this comment.
I've re-reviewed, think this is looking great. Thanks very much for this!
Summary
All other metadata fields (
label,weight,group,init_score) accept PyArrow ChunkedArray types as input, butpositiononly acceptsnumpy 1-D arrayorpandas Series. This is inconsistent and forces users working with Arrow-native or Polars data to manually convert to NumPy before passing position data. This contributes to #6204.Reference PRs (part of #6022)
Changes
positionfield