Fix a bug introduced in commit 72c6458.
read_svm_format should allow samples with no labels. However, the current version would trigger an exception.
The error can be produced by using any .svm file containing samples with no labels, or the ECtHR (A) dataset.
Because labels is None when no label is associated with an example, we should check whether it is None before calling split().
Test CLI & API (bash tests/autotest.sh)
Test APIs used by main.py.
[ ] Test Pass
(Copy and paste the last outputted line here.)
[x] Not Applicable (i.e., the PR does not include API changes.)
Check API Document
If any new APIs are added, please check if the description of the APIs is added to API document.
[x] Not Applicable (i.e., the PR does not include API changes.)
Test quickstart & API (bash tests/docs/test_changed_document.sh)
If any APIs in quickstarts or tutorials are modified, please run this test to check if the current examples can run correctly after the modified APIs are released.
What does this PR do?
Fix a bug introduced in commit 72c6458.
read_svm_format
should allow samples with no labels. However, the current version would trigger an exception. The error can be produced by using any.svm
file containing samples with no labels, or the ECtHR (A) dataset. Becauselabels
isNone
when no label is associated with an example, we should check whether it isNone
before callingsplit()
.Test CLI & API (
bash tests/autotest.sh
)Test APIs used by main.py.
Check API Document
If any new APIs are added, please check if the description of the APIs is added to API document.
Test quickstart & API (
bash tests/docs/test_changed_document.sh
)If any APIs in quickstarts or tutorials are modified, please run this test to check if the current examples can run correctly after the modified APIs are released.