allow negative samples (and regulate their amount for partial data) #116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In partial data (e.g.
ChEBIOver50Partial) a top class is selected and only subclasses of this top class are used as labels.The samples are filtered s.t. only samples with at least 1 positive label (i.e., subclasses of the top class) are used as samples.
The problem
no generalisation beyond beyond the top class (I trained a model on 30 labels (subclasses of 22712) and got ~70% macro-F1 with only samples that are subclasses of 22712, but 10% macro-F1 when looking at samples from the whole ChEBI.
Solution
Remove filters that only allow samples with at least 1 positive label, add a ratio parameter
external_data_ratiothat determines the amount of negative samples (0 for n negative samples, the current behaviour, 1 for all possible negative samples)