Skip to content

Optimize Unused Primitive Check#1140

Merged
tamargrey merged 4 commits intomainfrom
categorization-timing
Sep 4, 2020
Merged

Optimize Unused Primitive Check#1140
tamargrey merged 4 commits intomainfrom
categorization-timing

Conversation

@tamargrey
Copy link
Contributor

The check in dfs for unused primitives has been blowing up at the check for unused primitives when dfs produces many features. This PR makes two changes to help slow that down:

  • Instead of returning all of the features split into their primitive-type categorizations, _categorize_features now returns just the primitives used categorized into primitive types, meaning that if sum was used 4000 times, it only needs one entry in the categorization. This makes the check for unused primitives dependent on the number of possible primitives and not the number of possible features.
  • explored in _categorize_features is changed to be a set so that when we check explored to avoid repeating features, it's a constant time check

Note: This PR will go along with a change to the performance tests FeatureLabs/EntitySets#115 to include a test that produces more than 50K features so that we can see the impacts of this PR and future changes that might impact dfs at larger numbers of features

@codecov
Copy link

codecov bot commented Sep 4, 2020

Codecov Report

Merging #1140 into main will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1140      +/-   ##
==========================================
- Coverage   98.35%   98.35%   -0.01%     
==========================================
  Files         126      126              
  Lines       13309    13308       -1     
==========================================
- Hits        13090    13089       -1     
  Misses        219      219              
Impacted Files Coverage Δ
featuretools/synthesis/dfs.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 03b03ac...f3ea961. Read the comment docs.

@tamargrey tamargrey requested a review from rwedge September 4, 2020 16:25
dependencies.extend(feature_deps)

explored.append(feature.get_name())
explored.add(feature.get_name())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't catch the case where there are multiple versions of a primitive set with different parameters but one was unused. It wasn't caught before, and the question of what are unique primitive and feature names is outside the scope of this PR, so we'll revisit this at a later date via #1141

Copy link
Contributor

@rwedge rwedge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@tamargrey tamargrey merged commit 81f8362 into main Sep 4, 2020
@tamargrey tamargrey mentioned this pull request Sep 8, 2020
@rwedge rwedge deleted the categorization-timing branch September 21, 2020 19:20
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