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

Constant input warning in partial correlation reconstructor #201

Open
sdmccabe opened this issue May 22, 2019 · 2 comments
Open

Constant input warning in partial correlation reconstructor #201

sdmccabe opened this issue May 22, 2019 · 2 comments
Labels
question Further information is requested
Milestone

Comments

@sdmccabe
Copy link
Collaborator

From the tests:

tests/test_reconstruction.py::test_graph_size
tests/test_reconstruction.py::test_partial_correlation
  /home/main/.pyenv/versions/miniconda3-latest/lib/python3.6/site-packages/scipy/stats/stats.py:3399: PearsonRConstantInputWarning: An input array is constant; the correlation coefficent is not defined.
    warnings.warn(PearsonRConstantInputWarning())

Don't recall seeing this before, maybe a new warning in scipy? Plausible that the warning is nothing, but should explore further.

@sdmccabe sdmccabe added the question Further information is requested label May 22, 2019
@sdmccabe
Copy link
Collaborator Author

I didn't get this warning in an IPython session.

G = nx.ring_of_cliques(4, 16)
TS = netrd.dynamics.SherringtonKirkpatrickIsing().simulate(G, 1000)
H = netrd.reconstruction.PartialCorrelationMatrix().fit(TS)

@sdmccabe sdmccabe added this to the 1.0 milestone Oct 29, 2019
@admercs
Copy link

admercs commented Nov 26, 2019

This simply occurs when one of the input arrays contains constant values:

pearsonr([0,1,2,3], [0,0,0,0])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants