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

Projects
None yet
2 participants
@kmax12
Copy link
Member

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
@kmax12

kmax12 Apr 17, 2019

Author Member

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

This comment has been minimized.

Copy link
@kmax12

kmax12 Apr 17, 2019

Author Member

skew doesn't seem to matter as much as count

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

@kmax12 kmax12 force-pushed the update-string-primitives branch from cbe1eb0 to 8a7b3fd Apr 17, 2019

@kmax12 kmax12 requested a review from rwedge Apr 17, 2019

kmax12 and others added some commits Apr 17, 2019

@rwedge

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

Looks good

@rwedge

rwedge approved these changes Apr 18, 2019

@kmax12 kmax12 merged commit 3bfc61c into master Apr 18, 2019

2 of 4 checks passed

codecov/patch 84% of diff hit (target 96.1%)
Details
codecov/project 96.09% (-0.01%) compared to 698196a
Details
license/cla Contributor License Agreement is signed.
Details
test_all_python_versions Workflow: test_all_python_versions
Details

@rwedge rwedge referenced this pull request Apr 24, 2019

Merged

v0.7.1 #507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.