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

Add discriminability (one sample and two sample) #27

Merged
merged 30 commits into from
Dec 16, 2019

Conversation

jdey4
Copy link
Contributor

@jdey4 jdey4 commented Nov 21, 2019

Closes #13.

Added functionality for one sample test (@sampan501 ). This performs a one-sample test for whether the discriminability differs from random chance, as described in: https://www.biorxiv.org/content/10.1101/802629v1.full

@codecov
Copy link

codecov bot commented Nov 21, 2019

Codecov Report

Merging #27 into master will decrease coverage by 0.31%.
The diff coverage is 93.1%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #27      +/-   ##
==========================================
- Coverage   94.97%   94.66%   -0.32%     
==========================================
  Files          18       22       +4     
  Lines         717      862     +145     
==========================================
+ Hits          681      816     +135     
- Misses         36       46      +10
Impacted Files Coverage Δ
mgc/discrim/_utils.py 100% <100%> (ø)
mgc/discrim/discrimOneSample.py 84.84% <84.84%> (ø)
mgc/discrim/base.py 91.89% <91.89%> (ø)
mgc/discrim/discrimTwoSample.py 96.61% <96.61%> (ø)

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 0f57737...b18efb5. Read the comment docs.

@sampan501
Copy link
Member

sampan501 commented Nov 22, 2019

@jdey4 please add unit tests, code coverage is way to low

@jdey4
Copy link
Contributor Author

jdey4 commented Nov 23, 2019

@sampan501 added unit tests for oneSample test.

mgc/dscr/base.py Outdated Show resolved Hide resolved
mgc/dscr/oneSample.py Outdated Show resolved Hide resolved
mgc/dscr/oneSample.py Outdated Show resolved Hide resolved
mgc/dscr/oneSample.py Outdated Show resolved Hide resolved
mgc/dscr/oneSample.py Outdated Show resolved Hide resolved
mgc/dscr/oneSample.py Outdated Show resolved Hide resolved
mgc/dscr/oneSample.py Outdated Show resolved Hide resolved
mgc/dscr/oneSample.py Outdated Show resolved Hide resolved
docs/reference/dscr.rst Outdated Show resolved Hide resolved
mgc/dscr/oneSample.py Outdated Show resolved Hide resolved
@bdpedigo
Copy link
Contributor

bdpedigo commented Dec 1, 2019

I'd make the PR title more descriptive, even if this is a work in progress

mgc/discriminability/__init__.py Outdated Show resolved Hide resolved
mgc/discriminability/base.py Outdated Show resolved Hide resolved
mgc/discriminability/base.py Outdated Show resolved Hide resolved
mgc/discriminability/base.py Outdated Show resolved Hide resolved
mgc/discriminability/base.py Outdated Show resolved Hide resolved
mgc/discriminability/oneSample.py Outdated Show resolved Hide resolved
mgc/discriminability/oneSample.py Outdated Show resolved Hide resolved
mgc/discriminability/oneSample.py Outdated Show resolved Hide resolved
mgc/discriminability/oneSample.py Outdated Show resolved Hide resolved
mgc/discriminability/oneSample.py Outdated Show resolved Hide resolved
@sampan501
Copy link
Member

Also, far more unit tests are needed to maintain proper code coverage

mgc/discrim/base.py Outdated Show resolved Hide resolved
mgc/discrim/base.py Outdated Show resolved Hide resolved
@sampan501 sampan501 changed the title Jd Add discriminability (one sample and two sample) Dec 2, 2019
@sampan501 sampan501 closed this Dec 3, 2019
@sampan501 sampan501 reopened this Dec 3, 2019
@sampan501
Copy link
Member

Try rerunning Travis to reset cache

@netlify
Copy link

netlify bot commented Dec 9, 2019

Deploy preview for mgc-new ready!

Built with commit 2fd2f67

https://deploy-preview-27--mgc-new.netlify.com

@sampan501 sampan501 added the enhancement New feature or request label Dec 11, 2019
@sampan501
Copy link
Member

@jdey4 make sure you run black on all files to format them. More info can be found here: https://black.readthedocs.io/en/stable/

@sampan501 sampan501 added this to the mgc v0.0.1 milestone Dec 11, 2019
@codecov-io
Copy link

codecov-io commented Dec 15, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@470bb73). Click here to learn what that means.
The diff coverage is 87.57%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #27   +/-   ##
=========================================
  Coverage          ?   85.47%           
=========================================
  Files             ?       26           
  Lines             ?     1012           
  Branches          ?        0           
=========================================
  Hits              ?      865           
  Misses            ?      147           
  Partials          ?        0
Impacted Files Coverage Δ
mgc/discrim/discrim_one_samp.py 100% <100%> (ø)
mgc/discrim/base.py 100% <100%> (ø)
mgc/discrim/discrim_two_samp.py 67.24% <67.24%> (ø)
mgc/discrim/_utils.py 97.82% <97.82%> (ø)

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 470bb73...2fd2f67. Read the comment docs.

@jdey4
Copy link
Contributor Author

jdey4 commented Dec 15, 2019

@sampan501 could you have a look?

Copy link
Member

@sampan501 sampan501 left a comment

Choose a reason for hiding this comment

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

Mostly minor docs changes, 1 section with nested for loops can be compiled with numba.
@jdey4 Please add a link to the commit and line number under each comment of the review where the change has been made

mgc/discrim/__init__.py Outdated Show resolved Hide resolved
mgc/discrim/tests/test_discrimTwoSample.py Show resolved Hide resolved
mgc/discrim/tests/test_discrimTwoSample.py Outdated Show resolved Hide resolved
mgc/discrim/tests/test_discrimTwoSample.py Outdated Show resolved Hide resolved
mgc/discrim/tests/test_discrimTwoSample.py Outdated Show resolved Hide resolved
mgc/discrim/discrimOneSample.py Outdated Show resolved Hide resolved
mgc/discrim/base.py Outdated Show resolved Hide resolved
mgc/discrim/base.py Show resolved Hide resolved
mgc/discrim/base.py Show resolved Hide resolved
mgc/discrim/base.py Outdated Show resolved Hide resolved
@jdey4
Copy link
Contributor Author

jdey4 commented Dec 16, 2019

@sampan501 I could not add Numba and it seems that it needs broadcasting a large argument with Numba if I write a function to do the looping. It may seriously increase runtime.

@sampan501
Copy link
Member

@sampan501 I could not add Numba and it seems that it needs broadcasting a large argument with Numba if I write a function to do the looping. It may seriously increase runtime.

That is simply not true. Numba is a jit-compiler and increases speed of nested for loops and numpy operations. See https://numba.pydata.org/numba-doc/latest/user/5minguide.html

@sampan501
Copy link
Member

Also can you link where you addressed my comments in the commits? It is not clear at all based on the names of your commits

@sampan501 sampan501 merged commit 0a9a0c5 into neurodata:master Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add discriminability
4 participants