-
Notifications
You must be signed in to change notification settings - Fork 30
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
ENH: Save model level output (r-squared) #224
Conversation
@tyarkoni are Those are the two maps exposed by |
Hello @adelavega, Thank you for updating!
To test for issues locally, Comment last updated at 2020-04-06 12:59:55 UTC |
hey @jdkent, you mind taking a look? should be fairly straight forward, but looks like you contributed adding r-squared and residuals to the |
Looks like tests are failing because of a MemoryError! Unfortunately, the new images are surprisingly memory intensive to produce. |
flm = level1.FirstLevelModel( | ||
minimize_memory=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's this line that's killing us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and no.
Yes because that argument must be set to true for those images to be saved to that object. Otherwise, because they are not super necessary they are deleted along with a bunch of other stuff.
@jdkent maybe there's another way to access these images without triggering a bunch of other stuff to be kept around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell, that argument saves the SimpleRegressionResult
object, and without it, you can't get the other model outputs.
nistats is also archived, so proposing an alternative for now is not possible.
Maybe we can just make this optional in fitlins? I'll raise an issue over there and see what they say.
When I test locally, my docker container only hits around 400mb of memory usage. Looks like Circle CI's memory is probably quite low, and creating the residuals map (which is 4D) is momentarily very memory intensive. I don't actually need the residuals, just the r-squared, so removing for now to see if tests pass. We could make some or all of these optional by user CLI flags. |
popping in to say that I do not know of a currently builtin way to save only what we want, and delete other pieces of information, sorry! (working on filtering my notifications so I can see mentions sooner). I'll take a look and see if I have anything helpful to add. |
Thanks @jdkent Well, the important tests are passing now! So I think just computing the residuals is the most memory intensive part. For now, I'll just output r-squared as that's what I care about, but we could add a CLI option for the others. |
Codecov Report
@@ Coverage Diff @@
## master #224 +/- ##
==========================================
+ Coverage 77.32% 77.62% +0.29%
==========================================
Files 18 18
Lines 1045 1059 +14
Branches 188 189 +1
==========================================
+ Hits 808 822 +14
Misses 149 149
Partials 88 88
Continue to review full report at Codecov.
|
@effigies this is what the output file looks like. look reasonable? it's at the run-level for the whole model:
arguably, it should just be |
4281443
to
1d8fb80
Compare
How you are getting To fix the memory issues, a more flexible interface within Similar to how effigies suggested the 'all' output for computing contrasts, I could see a parameter that saves |
Either is fine with me. |
Looks like there's an issue with a duecredit dependency: brechtm/citeproc-py#94 May want to remove that for the time being. |
hey @jdkent do you know if I can access other model attributes such as I'm going to open another PR trying to get that file to be output as well. @effigies Do you think these should always be output, or by CLI option? I can work that into the next PR as well. |
Are we running up against space constraints with FitLins outputs? Residuals will take up a ton, but if this is just one volume per run (as opposed to one volume per regressor) I'm not worried. |
Yeah it's just one volume per run. I suppose the main downside is we have to run with the save memory False for nistats. I'm not concerned about the output size too much. |
you should be able to access LogL with the private method (LogL is just a 3-d output right?) |
yep, thanks! looked at your code and figured that out. |
Closes #221