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

Mean ignore NaNs #379

Merged
merged 8 commits into from Jan 24, 2019

Conversation

Projects
None yet
2 participants
@gsheni
Copy link
Contributor

gsheni commented Jan 22, 2019

  • Modified the Mean primitive so it can be user controlled to ignore NaNs or not.
  • Wrote simple test case to test the function.

gsheni added some commits Jan 22, 2019

@gsheni gsheni changed the title primitive and test case Mean ignore NaNs Jan 22, 2019

@codecov

This comment has been minimized.

Copy link

codecov bot commented Jan 22, 2019

Codecov Report

Merging #379 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #379      +/-   ##
==========================================
+ Coverage   95.74%   95.79%   +0.05%     
==========================================
  Files          89       89              
  Lines        7730     7751      +21     
==========================================
+ Hits         7401     7425      +24     
+ Misses        329      326       -3
Impacted Files Coverage Δ
...ools/primitives/standard/aggregation_primitives.py 95.54% <100%> (+0.09%) ⬆️
...aturetools/tests/primitive_tests/test_agg_feats.py 99.17% <100%> (+0.06%) ⬆️
...aturetools/primitives/standard/binary_transform.py 98.89% <0%> (+1.1%) ⬆️

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 23c7f36...3858001. Read the comment docs.

@kmax12 kmax12 self-requested a review Jan 23, 2019

@kmax12

kmax12 approved these changes Jan 23, 2019

mean_func = Mean().get_function()
array = np.array([5, 5, 5, 5, 5])
assert mean_func(array) == 5
array = np.array([5, np.nan, np.nan, np.nan, np.nan, 10])

This comment has been minimized.

@kmax12

kmax12 Jan 23, 2019

Member

you should add a test case where there are nans in the list, but ignore_nans=False

This comment has been minimized.

@gsheni

gsheni Jan 23, 2019

Author Contributor

Fixed.

gsheni added some commits Jan 23, 2019

@kmax12

This comment has been minimized.

Copy link
Member

kmax12 commented Jan 24, 2019

Looks good to me!

@gsheni gsheni merged commit 7f78c98 into master Jan 24, 2019

3 checks passed

codecov/patch 100% of diff hit (target 95.74%)
Details
codecov/project 95.79% (+0.05%) compared to 23c7f36
Details
license/cla Contributor License Agreement is signed.
Details

@gsheni gsheni deleted the mean_nans branch Jan 24, 2019

@rwedge rwedge referenced this pull request Jan 30, 2019

Merged

v0.6.0 #387

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment