-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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-package] fix retrain on sequence dataset #6414
base: master
Are you sure you want to change the base?
Changes from 1 commit
2b7811b
a07800c
3ac186c
ecd5746
b3bcf37
48f062c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,6 +223,10 @@ def test_retrain_list_of_sequence(): | |
|
||
seq_ds = lgb.Dataset(seqs, label=y, free_raw_data=False) | ||
|
||
assert sum([len(s) for s in seq_ds.get_data()]) == X.shape[0] | ||
assert len(seq_ds.get_feature_name()) == X.shape[1] | ||
assert seq_ds.get_data() == seqs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These checks should be moved after training, to avoid this test failure: https://github.com/microsoft/LightGBM/actions/runs/9935170010/job/27451324230?pr=6414
Please run the tests yourself before pushing another commit. sh build-python.sh bdist_wheel install
pytest tests/python_package_tests/test_basic.py::test_retrain_list_of_sequence There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I only tested the code on jupyter notebook for this case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I will push testing changes for you. |
||
|
||
params = { | ||
"objective": "binary", | ||
"num_boost_round": 20, | ||
|
@@ -249,7 +253,6 @@ def test_retrain_list_of_sequence(): | |
assert model2.current_iteration() == 20 | ||
assert model2.num_trees() == 20 | ||
|
||
assert seq_ds.get_data() == seqs | ||
|
||
def test_chunked_dataset(): | ||
X_train, X_test, y_train, y_test = train_test_split( | ||
|
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.
Why was
free_raw_data=False
necessary here? If it wasn't, please remove it.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.
If free_raw_data=True, model2 cannot get the data, would raise Exception I remember .