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

Improve performance of aggregation feature calculation #209

Merged
merged 1 commit into from Aug 15, 2018

Conversation

kmax12
Copy link
Contributor

@kmax12 kmax12 commented Aug 14, 2018

We had logic that checked for the case where the dataframe we were aggregating on was empty or had no related instances. This logic involved a slow python loop. Due to how we fill in missing values later in the function, this check was unnecessary and could be removed.

In some benchmarks, I saw 25% speeds ups for calculations.

Also, added test for the empty child dataframe case, which was previously untested.

@codecov-io
Copy link

Codecov Report

Merging #209 into master will increase coverage by 0.02%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #209      +/-   ##
==========================================
+ Coverage   93.46%   93.48%   +0.02%     
==========================================
  Files          71       71              
  Lines        7784     7757      -27     
==========================================
- Hits         7275     7252      -23     
+ Misses        509      505       -4
Impacted Files Coverage Δ
...tests/computational_backend/test_pandas_backend.py 100% <100%> (ø) ⬆️
...turetools/computational_backends/pandas_backend.py 91.72% <75%> (+0.43%) ⬆️

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 94132fc...141adb5. Read the comment docs.

@kmax12 kmax12 requested a review from rwedge August 14, 2018 17:28
@rwedge
Copy link
Collaborator

rwedge commented Aug 15, 2018

Looks good!

@rwedge rwedge merged commit 391a927 into master Aug 15, 2018
@rwedge rwedge mentioned this pull request Aug 20, 2018
@kmax12 kmax12 deleted the remove-slow-related-check branch October 2, 2018 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

3 participants