bd2kccd / r-causal

R Wrapper for Tetrad Library
35 stars 19 forks source link

gfci.discrete null pointer exception error #36

Open kingfish777 opened 7 years ago

kingfish777 commented 7 years ago

When I

a <- c(1,1,1,0,0,0) b <- c(1,1,0,1,1,0) df <- data.frame(cbind(a,b))

gfci.discrete(df)

I get the following:

Graph Parameters:
structurePrior =  1 
samplePrior =  1 
maxDegree =  3 
maxPathLength =  -1 
significance =  0.05 
completeRuleSetUsed =  FALSE 
faithfulnessAssumed =  TRUE 
verbose =  FALSE 
Error in .jcall(gfci_instance, "Ledu/cmu/tetrad/graph/Graph;", "search") : 
  java.lang.NullPointerException
jdramsey commented 7 years ago

I did see this, but I'm not sure how to answer yet. Is the issue that if you have a and b with those 7 discrete values you get a null pointer? I guess I could try to build that case in Java...

kingfish777 commented 7 years ago

dat.txt fake data attached, same as r-causal for this issue. GFCI in tetrad-gui says "Data Set must be either discrete or continuous", even after I discretize. I tried taking out the penalty discount (only for continuous) and messing with a few other params, but still get that message. I'd suggest recreating issue as you suggested directly in Java API. (I would but I am busy with possible AMIA paper). As an aside, I think that there ought to be a way to pick between GFCI.discrete and regular continuous GFCI in the GUI. But I usually do not use the GUI, except for initial experimentation / trying out unfamiliar features.

jdramsey commented 7 years ago

GFCI in the current interface (GUI) handles this OK. I'm taking it this has been fixed. Reopen if not true.

kingfish777 commented 7 years ago

Still seeing the null pointer exception error:

> dat
  a b c d
 1 0 1 0
 1 0 0 1
 1 0 1 0
 0 1 0 1
 0 1 1 0
 0 1 0 0

...

Error in .jcall(gfci_instance, "Ledu/cmu/tetrad/graph/Graph;", "search") : 
  java.lang.NullPointerException
jdramsey commented 7 years ago

Your view is I'm not busy? :( I happened to have the GUI open though and tried your data that you said threw a null pointer exception, and I couldn't replicate that. Maybe you're not using the most recent version? Or didn't take out the line numbers?

You can switch from continuous to discrete GFCI by just using all discrete or all continuous data.

On Sun, Jun 11, 2017 at 6:13 AM, Kingfish Threesevens < notifications@github.com> wrote:

Still seeing the null pointer exception error:

dat a b c d 1 1 0 1 0 2 1 0 0 1 3 1 0 1 0 4 0 1 0 1 5 0 1 1 0 6 0 1 0 0

...

Error in .jcall(gfci_instance, "Ledu/cmu/tetrad/graph/Graph;", "search") : java.lang.NullPointerException

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bd2kccd/r-causal/issues/36#issuecomment-307618745, or mute the thread https://github.com/notifications/unsubscribe-auth/AJZZRwIHBw17lzZHa6DvYb5JOS_EpBQqks5sC73AgaJpZM4MOub0 .

-- Joseph D. Ramsey Special Faculty and Director of Research Computing Department of Philosophy 135 Baker Hall Carnegie Mellon University Pittsburgh, PA 15213

jsph.ramsey@gmail.com Office: (412) 268-8063 http://www.andrew.cmu.edu/user/jdramsey

jdramsey commented 7 years ago

In the GUI that is. You can also use mixed data.

On Sun, Jun 11, 2017 at 6:05 PM, Joseph Ramsey jdramsey@andrew.cmu.edu wrote:

Your view is I'm not busy? :( I happened to have the GUI open though and tried your data that you said threw a null pointer exception, and I couldn't replicate that. Maybe you're not using the most recent version? Or didn't take out the line numbers?

You can switch from continuous to discrete GFCI by just using all discrete or all continuous data.

On Sun, Jun 11, 2017 at 6:13 AM, Kingfish Threesevens < notifications@github.com> wrote:

Still seeing the null pointer exception error:

dat a b c d 1 1 0 1 0 2 1 0 0 1 3 1 0 1 0 4 0 1 0 1 5 0 1 1 0 6 0 1 0 0

...

Error in .jcall(gfci_instance, "Ledu/cmu/tetrad/graph/Graph;", "search") : java.lang.NullPointerException

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bd2kccd/r-causal/issues/36#issuecomment-307618745, or mute the thread https://github.com/notifications/unsubscribe-auth/AJZZRwIHBw17lzZHa6DvYb5JOS_EpBQqks5sC73AgaJpZM4MOub0 .

-- Joseph D. Ramsey Special Faculty and Director of Research Computing Department of Philosophy 135 Baker Hall Carnegie Mellon University Pittsburgh, PA 15213

jsph.ramsey@gmail.com Office: (412) 268-8063 http://www.andrew.cmu.edu/user/jdramsey

-- Joseph D. Ramsey Special Faculty and Director of Research Computing Department of Philosophy 135 Baker Hall Carnegie Mellon University Pittsburgh, PA 15213

jsph.ramsey@gmail.com Office: (412) 268-8063 http://www.andrew.cmu.edu/user/jdramsey

kingfish777 commented 7 years ago

There are no line numbers in the data. That row # may have been stored by accident. I am using the most recent version of r-causal. And I have replicated the error there.

Getting GFCI (either continuous or discrete) in the R API cleaned up is not that high of a priority for me, just a nice to have, and something for the team to be aware of. I do not expect these things to be resolved in any sort of unreasonable time scale.

I am super busy too!


From: Joseph Ramsey notifications@github.com Sent: Sunday, June 11, 2017 5:05 PM To: bd2kccd/r-causal Cc: Malec, Scott A; Author Subject: Re: [bd2kccd/r-causal] gfci.discrete null pointer exception error (#36)

Your view is I'm not busy? :( I happened to have the GUI open though and tried your data that you said threw a null pointer exception, and I couldn't replicate that. Maybe you're not using the most recent version? Or didn't take out the line numbers?

You can switch from continuous to discrete GFCI by just using all discrete or all continuous data.

On Sun, Jun 11, 2017 at 6:13 AM, Kingfish Threesevens < notifications@github.com> wrote:

Still seeing the null pointer exception error:

dat a b c d 1 1 0 1 0 2 1 0 0 1 3 1 0 1 0 4 0 1 0 1 5 0 1 1 0 6 0 1 0 0

...

Error in .jcall(gfci_instance, "Ledu/cmu/tetrad/graph/Graph;", "search") : java.lang.NullPointerException

- You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bd2kccd/r-causal/issues/36#issuecomment-307618745, or mute the thread https://github.com/notifications/unsubscribe-auth/AJZZRwIHBw17lzZHa6DvYb5JOS_EpBQqks5sC73AgaJpZM4MOub0 .

-- Joseph D. Ramsey Special Faculty and Director of Research Computing Department of Philosophy 135 Baker Hall Carnegie Mellon University Pittsburgh, PA 15213

jsph.ramsey@gmail.com Office: (412) 268-8063 http://www.andrew.cmu.edu/user/jdramsey

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_bd2kccd_r-2Dcausal_issues_36-23issuecomment-2D307660021&d=DwMFaQ&c=6vgNTiRn9_pqCD9hKx9JgXN1VapJQ8JVoF8oWH1AgfQ&r=cJocORfYogykfmw40_PYbTR-_FlW5GZ15C5SG7IuxyE&m=44r2_AoQ-jRqSjpMsY8fVb4pAKscOELhru5BnGjL2_Q&s=Lr7S6CRe-HCNR-wxfvwmrSMZQfiiCyBhCla2kao1Es0&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ACh2SMpxOT1H4BO8eHLkQT7PqMaXO7d0ks5sDGS1gaJpZM4MOub0&d=DwMFaQ&c=6vgNTiRn9_pqCD9hKx9JgXN1VapJQ8JVoF8oWH1AgfQ&r=cJocORfYogykfmw40_PYbTR-_FlW5GZ15C5SG7IuxyE&m=44r2_AoQ-jRqSjpMsY8fVb4pAKscOELhru5BnGjL2_Q&s=5kpyEPGViSqrlDq9B2A5VVPPWW9qpXDjrvuAUOZISP4&e=.

jdramsey commented 7 years ago

I cannot replicate you problem in the Tetrad GUI. I load the (fake, small) data, run GFCI, and it comes back with a graph with no edges in it, but no exception. I'll wait to hear what Kong says.

Not sure what's not cleaned up about GFCI. I don't use the R version though.

On Mon, Jun 12, 2017 at 10:58 AM, Kingfish Threesevens < notifications@github.com> wrote:

There are no line numbers in the data. That row # may have been stored by accident. I am using the most recent version of r-causal. And I have replicated the error there.

Getting GFCI (either continuous or discrete) in the R API cleaned up is not that high of a priority for me, just a nice to have, and something for the team to be aware of. I do not expect these things to be resolved in any sort of unreasonable time scale.

I am super busy too!


From: Joseph Ramsey notifications@github.com Sent: Sunday, June 11, 2017 5:05 PM To: bd2kccd/r-causal Cc: Malec, Scott A; Author Subject: Re: [bd2kccd/r-causal] gfci.discrete null pointer exception error (#36)

Your view is I'm not busy? :( I happened to have the GUI open though and tried your data that you said threw a null pointer exception, and I couldn't replicate that. Maybe you're not using the most recent version? Or didn't take out the line numbers?

You can switch from continuous to discrete GFCI by just using all discrete or all continuous data.

On Sun, Jun 11, 2017 at 6:13 AM, Kingfish Threesevens < notifications@github.com> wrote:

Still seeing the null pointer exception error:

dat a b c d 1 1 0 1 0 2 1 0 0 1 3 1 0 1 0 4 0 1 0 1 5 0 1 1 0 6 0 1 0 0

...

Error in .jcall(gfci_instance, "Ledu/cmu/tetrad/graph/Graph;", "search") : java.lang.NullPointerException

- You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bd2kccd/r-causal/issues/36#issuecomment-307618745, or mute the thread https://github.com/notifications/unsubscribe-auth/ AJZZRwIHBw17lzZHa6DvYb5JOS_EpBQqks5sC73AgaJpZM4MOub0 .

-- Joseph D. Ramsey Special Faculty and Director of Research Computing Department of Philosophy 135 Baker Hall Carnegie Mellon University Pittsburgh, PA 15213

jsph.ramsey@gmail.com Office: (412) 268-8063 http://www.andrew.cmu.edu/user/jdramsey

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense. proofpoint.com/v2/url?u=https-3A__github.com_bd2kccd_r-2Dcausal_issues_36- 23issuecomment-2D307660021&d=DwMFaQ&c=6vgNTiRn9_ pqCD9hKx9JgXN1VapJQ8JVoF8oWH1AgfQ&r=cJocORfYogykfmw40_PYbTR- _FlW5GZ15C5SG7IuxyE&m=44r2_AoQ-jRqSjpMsY8fVb4pAKscOELhru5BnGj L2_Q&s=Lr7S6CRe-HCNR-wxfvwmrSMZQfiiCyBhCla2kao1Es0&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https- 3A__github.com_notifications_unsubscribe-2Dauth_ ACh2SMpxOT1H4BO8eHLkQT7PqMaXO7d0ks5sDGS1gaJpZM4MOub0&d=DwMFaQ&c=6vgNTiRn9_ pqCD9hKx9JgXN1VapJQ8JVoF8oWH1AgfQ&r=cJocORfYogykfmw40_PYbTR- _FlW5GZ15C5SG7IuxyE&m=44r2_AoQ-jRqSjpMsY8fVb4pAKscOELhru5BnGjL2_Q&s= 5kpyEPGViSqrlDq9B2A5VVPPWW9qpXDjrvuAUOZISP4&e=.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bd2kccd/r-causal/issues/36#issuecomment-307815498, or mute the thread https://github.com/notifications/unsubscribe-auth/AJZZR6krSSlX-8E5yok5NALerCXl_-lDks5sDVIZgaJpZM4MOub0 .

-- Joseph D. Ramsey Special Faculty and Director of Research Computing Department of Philosophy 135 Baker Hall Carnegie Mellon University Pittsburgh, PA 15213

jsph.ramsey@gmail.com Office: (412) 268-8063 http://www.andrew.cmu.edu/user/jdramsey

kingfish777 commented 7 years ago

Then it sounds as though the bug may be localized to the R API.


As far as I have tested, none of the other algorithms produce in this error in r-causal.

I only use r-causal because it is often convenient for quick scripting purposes.


From: Joseph Ramsey notifications@github.com Sent: Monday, June 12, 2017 11:40 AM To: bd2kccd/r-causal Cc: Malec, Scott A; Author Subject: Re: [bd2kccd/r-causal] gfci.discrete null pointer exception error (#36)

I cannot replicate you problem in the Tetrad GUI. I load the (fake, small) data, run GFCI, and it comes back with a graph with no edges in it, but no exception. I'll wait to hear what Kong says.

Not sure what's not cleaned up about GFCI. I don't use the R version though.

On Mon, Jun 12, 2017 at 10:58 AM, Kingfish Threesevens < notifications@github.com> wrote:

There are no line numbers in the data. That row # may have been stored by accident. I am using the most recent version of r-causal. And I have replicated the error there.

Getting GFCI (either continuous or discrete) in the R API cleaned up is not that high of a priority for me, just a nice to have, and something for the team to be aware of. I do not expect these things to be resolved in any sort of unreasonable time scale.

I am super busy too!


From: Joseph Ramsey notifications@github.com Sent: Sunday, June 11, 2017 5:05 PM To: bd2kccd/r-causal Cc: Malec, Scott A; Author Subject: Re: [bd2kccd/r-causal] gfci.discrete null pointer exception error (#36)

Your view is I'm not busy? :( I happened to have the GUI open though and tried your data that you said threw a null pointer exception, and I couldn't replicate that. Maybe you're not using the most recent version? Or didn't take out the line numbers?

You can switch from continuous to discrete GFCI by just using all discrete or all continuous data.

On Sun, Jun 11, 2017 at 6:13 AM, Kingfish Threesevens < notifications@github.com> wrote:

Still seeing the null pointer exception error:

dat a b c d 1 1 0 1 0 2 1 0 0 1 3 1 0 1 0 4 0 1 0 1 5 0 1 1 0 6 0 1 0 0

...

Error in .jcall(gfci_instance, "Ledu/cmu/tetrad/graph/Graph;", "search") : java.lang.NullPointerException

- You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bd2kccd/r-causal/issues/36#issuecomment-307618745, or mute the thread https://github.com/notifications/unsubscribe-auth/ AJZZRwIHBw17lzZHa6DvYb5JOS_EpBQqks5sC73AgaJpZM4MOub0 .

-- Joseph D. Ramsey Special Faculty and Director of Research Computing Department of Philosophy 135 Baker Hall Carnegie Mellon University Pittsburgh, PA 15213

jsph.ramsey@gmail.com Office: (412) 268-8063 http://www.andrew.cmu.edu/user/jdramsey

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense. proofpoint.com/v2/url?u=https-3A__github.com_bd2kccd_r-2Dcausal_issues_36- 23issuecomment-2D307660021&d=DwMFaQ&c=6vgNTiRn9_ pqCD9hKx9JgXN1VapJQ8JVoF8oWH1AgfQ&r=cJocORfYogykfmw40_PYbTR- _FlW5GZ15C5SG7IuxyE&m=44r2_AoQ-jRqSjpMsY8fVb4pAKscOELhru5BnGj L2_Q&s=Lr7S6CRe-HCNR-wxfvwmrSMZQfiiCyBhCla2kao1Es0&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https- 3A__github.com_notifications_unsubscribe-2Dauth_ ACh2SMpxOT1H4BO8eHLkQT7PqMaXO7d0ks5sDGS1gaJpZM4MOub0&d=DwMFaQ&c=6vgNTiRn9_ pqCD9hKx9JgXN1VapJQ8JVoF8oWH1AgfQ&r=cJocORfYogykfmw40_PYbTR- _FlW5GZ15C5SG7IuxyE&m=44r2_AoQ-jRqSjpMsY8fVb4pAKscOELhru5BnGjL2_Q&s= 5kpyEPGViSqrlDq9B2A5VVPPWW9qpXDjrvuAUOZISP4&e=.

- You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bd2kccd/r-causal/issues/36#issuecomment-307815498, or mute the thread https://github.com/notifications/unsubscribe-auth/AJZZR6krSSlX-8E5yok5NALerCXl_-lDks5sDVIZgaJpZM4MOub0 .

-- Joseph D. Ramsey Special Faculty and Director of Research Computing Department of Philosophy 135 Baker Hall Carnegie Mellon University Pittsburgh, PA 15213

jsph.ramsey@gmail.com Office: (412) 268-8063 http://www.andrew.cmu.edu/user/jdramsey

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_bd2kccd_r-2Dcausal_issues_36-23issuecomment-2D307845785&d=DwMFaQ&c=6vgNTiRn9_pqCD9hKx9JgXN1VapJQ8JVoF8oWH1AgfQ&r=cJocORfYogykfmw40_PYbTR-_FlW5GZ15C5SG7IuxyE&m=Tw1QwMx8KILhktV-SUssn8PFWodU8-tP_xvUYztvY1s&s=Xmh7wSNkUDZXWgcfUC7vI5-Yl97vxo-9FCJ8pOkqx5Y&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ACh2SB-2DjwzERhAJSb72oeBxYdqN5eV-5FCks5sDWnkgaJpZM4MOub0&d=DwMFaQ&c=6vgNTiRn9_pqCD9hKx9JgXN1VapJQ8JVoF8oWH1AgfQ&r=cJocORfYogykfmw40_PYbTR-_FlW5GZ15C5SG7IuxyE&m=Tw1QwMx8KILhktV-SUssn8PFWodU8-tP_xvUYztvY1s&s=XvkdzTlB7EjEvNISF6DZlFI7kLy21NJCVkjHmHR-nrE&e=.

chirayukong commented 7 years ago

It seems to be a problem when the search result got no edges. It doesn't get the null exception when I run it on PyThon. It might have a problem with the rJava library. Let me check.

kingfish777 commented 7 years ago

New and improved fake data attached. dat.txt