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

Mean ignore NaNs #379

Merged
merged 8 commits into from
Jan 24, 2019
Merged

Mean ignore NaNs #379

merged 8 commits into from
Jan 24, 2019

Conversation

gsheni
Copy link
Contributor

@gsheni 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 gsheni changed the title primitive and test case Mean ignore NaNs Jan 22, 2019
@codecov
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 January 23, 2019 19:03
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])
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@kmax12
Copy link
Contributor

kmax12 commented Jan 24, 2019

Looks good to me!

@gsheni gsheni merged commit 7f78c98 into master Jan 24, 2019
@gsheni gsheni deleted the mean_nans branch January 24, 2019 16:16
@rwedge rwedge mentioned this pull request Jan 30, 2019
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