ASUS-AICS / LibMultiLabel

A library for multi-class and multi-label classification
MIT License
152 stars 30 forks source link

Fix read_svm_format when no label is associated with an example #327

Closed sammer1107 closed 1 year ago

sammer1107 commented 1 year ago

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. 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.

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.