Skip to content
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

detect task type #337

Merged
merged 8 commits into from
Dec 7, 2023
Merged

detect task type #337

merged 8 commits into from
Dec 7, 2023

Conversation

donglihe-hub
Copy link
Contributor

@donglihe-hub donglihe-hub commented Nov 3, 2023

What does this PR do?

  1. Align with nn
  2. Reproduce results
  • (Align with nn) Now models will remember the task type (multiclass=True or False) after training. The task type will then be used during testing process.

  • Raise an error when users try to train binary/multiclass models with "tree".

  • Raise an error when the ratio of unlabeled instances is larger than 10% in the training dataset.

1. Reproduction Results (Using Codes from this PR):

Linear ECtHR (A) (unlabeled) ECtHR (B) (unlabeled) SCOTUS EUR-LEX LEDGAR UNFAIR-ToS (unlabeled)
one-vs-rest 69.6/54.6 75.6/68.8 78.1/68.9 72.0/55.4 86.4/80.0 70.1/72.3
threshold 74.1/68.4 77.2/73.6 79.1/71.8 74.6/62.3 86.2/79.5 75.7/77.1
cost-sensitive 72.9/63.6 76.8/72.2 78.3/71.5 73.4/60.5 86.2/80.1 74.4/75.4

Metric format: Micro-F1/Macro-F1

Results in Yuchen's Paper

1701383782058

2. Causes of the Differences in Unfair-ToS

(Will not fix) There is a huge gap in the results of unfair-tos because currently LibMultiLabel doesn't support unlabeled samples during the test process.

(TODO) Will check if Yuchen's method is reasonable. Will figure out a workaround in the latest LibMultiLabel.

Currently, multiclass datasets using train_{1vsrest, cost_sensitive, etc.} will not be correctly recognized as multiclass datasets. As a result, the result of Micro-F1 is not equal to P@1.
Now the task type will be determined using the function from commom_utils.

* (A bit more) The task type can either be detected automatically (set "is_multilabel" to "auto" in config file) or be provided by users (Li-Chung will explain the motivation)

Test CLI & API (bash tests/autotest.sh)

Test APIs used by main.py.

  • Test Pass
    • (Copy and paste the last outputted line here.)
  • 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.

  • API document is updated (linear, nn)
  • 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.

@cjlin1 cjlin1 merged commit ec603a8 into ASUS-AICS:master Dec 7, 2023
1 check passed
@donglihe-hub donglihe-hub deleted the task branch December 11, 2023 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants