fix: sample training data after splitting #83
Merged
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.
This now uniformly samples training data after the train-test-split, meaning that we always have a constant test size of 3434 complexes
Only issue I would see here is that the current code does not consider the case where there is a ligand in the test set that is not part of the train set. That causesz the model to "never see such a ligand" and thus decrease performance significantly
For this, we would however need to build our own "iterative stratified sapling" which is rather a hassle to implement. We could just include it in the conclusion of our project for now!
https://stackoverflow.com/questions/45516424/sklearn-train-test-split-on-pandas-stratify-by-multiple-columns