Set multiple unique features in one SQL query for feature extractors#39
Open
chrjabs wants to merge 2 commits into
Open
Set multiple unique features in one SQL query for feature extractors#39chrjabs wants to merge 2 commits into
chrjabs wants to merge 2 commits into
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I noticed that running the
wcnfbasefeature extractor took a long time even after the features had already been extracted for all instances. Turns out writing the features one by one into the database is really inefficient.With this PR the
set_valuesmethods ofDatabaseandSchemanow take dicts of multiple values and write as much as possible in one SQL query. I'm not sure I fully understand the schema for non-unique features, so I tried to not modify the logic there.This made a
wcnfbasefeature extraction run for me go from ~20 minutes to 40 seconds.