This repository was archived by the owner on Apr 8, 2025. It is now read-only.
Remove baskets without features in _create_dataset.#461
Closed
ftesser wants to merge 1 commit intodeepset-ai:masterfrom
Closed
Remove baskets without features in _create_dataset.#461ftesser wants to merge 1 commit intodeepset-ai:masterfrom
ftesser wants to merge 1 commit intodeepset-ai:masterfrom
Conversation
brandenchan
suggested changes
Jul 20, 2020
| logger.warning(f"Removing the following baskets because of errors in computing features:") | ||
| for basket in basket_to_remove: | ||
| logger.warning(f"Basket id: id_internal: {basket.id_internal}, id_external: {basket.id_external}") | ||
| self.baskets.remove(basket) |
Contributor
There was a problem hiding this comment.
An error could be thrown here if a basket contains multiple samples where sample.features is None
| if sample.features is None: | ||
| basket_to_remove.append(basket) | ||
| else: | ||
| features_flat.extend(sample.features) |
Contributor
There was a problem hiding this comment.
If one set of sample.features is None, all sample.features from the same basket need to be thrown out otherwise we may have features which belong to a basket which has been removed. So we should probably first iterate over all samples in the basket to check if any have features = None. If there are, we remove all features. If not, then we can add all to features_flat
Contributor
Author
There was a problem hiding this comment.
thanks @brandenchan for the suggestions. I am going to close this PR and create a new one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 is proposals 2 for #457.
I have added some additional info on the id that contains errors (so if someone want to check the data can find them).
The removal is done on _create_dataset.