Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove primitives that return strings instead of functions #499

Merged
merged 8 commits into from Apr 18, 2019

Conversation

kmax12
Copy link
Contributor

@kmax12 kmax12 commented Apr 16, 2019

We were returning strings in some cases to improve performance. This breaks api with other primitives. We can simply return pandas objects instead add the string optimization into pandas backend.

@codecov
Copy link

codecov bot commented Apr 16, 2019

Codecov Report

Merging #499 into master will decrease coverage by <.01%.
The diff coverage is 84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #499      +/-   ##
==========================================
- Coverage    96.1%   96.09%   -0.01%     
==========================================
  Files         108      108              
  Lines        8853     8862       +9     
==========================================
+ Hits         8508     8516       +8     
- Misses        345      346       +1
Impacted Files Coverage Δ
featuretools/utils/gen_utils.py 88.63% <100%> (+0.54%) ⬆️
featuretools/primitives/utils.py 96.42% <100%> (-0.05%) ⬇️
featuretools/utils/api.py 100% <100%> (ø) ⬆️
...ools/primitives/standard/aggregation_primitives.py 94.87% <70%> (+0.04%) ⬆️
...turetools/computational_backends/pandas_backend.py 98.07% <88.88%> (-0.29%) ⬇️

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 698196a...82c93a1. Read the comment docs.

@@ -26,7 +26,7 @@ class Count(AggregationPrimitive):
default_value = 0

def get_function(self):
return 'count'
return pd.Series.count
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 actually isn't as performant. added question on stackoverflow here: https://stackoverflow.com/questions/55731149/use-a-function-instead-of-string-in-pandas-groupby-agg

@@ -261,7 +261,7 @@ class Skew(AggregationPrimitive):
stack_on_self = False

def get_function(self):
return 'skew'
return pd.Series.skew
Copy link
Contributor Author

Choose a reason for hiding this comment

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

skew doesn't seem to matter as much as count

Screen Shot 2019-04-17 at 11 36 02 AM

@kmax12 kmax12 requested a review from rwedge April 17, 2019 18:21
@rwedge
Copy link
Contributor

rwedge commented Apr 18, 2019

Looks good

@kmax12 kmax12 merged commit 3bfc61c into master Apr 18, 2019
@rwedge rwedge mentioned this pull request Apr 24, 2019
@rwedge rwedge deleted the update-string-primitives branch February 19, 2021 21:41
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.

None yet

2 participants