77 sparseoptimization pattern discrepancy#125
Conversation
dimalvovs
commented
Nov 15, 2024
- add comments to chi-squared calc
- add 1 to denominator and numerator to avoid NaN in chi-squared calc
vignette
drbergman
left a comment
There was a problem hiding this comment.
I can't comment on how the 1+'s will affect calculations and their accuracy for a chisq calculation. I'll only ask: isn't the purpose of the SparseIterator that it will skip all 0 values? So dsq = get<1>(it) * get<1>(it) must be > 0?
Also, though it's clearly outside the scope of this PR, it feels like there's the possibility for computational savings by storing the results of the dot products inside the for loop to be re-used in the while loop. Similarly, I think the dsq values are constant throughout the CoGAPS run (they're just the element-wise square of the genes x sample matrix, right?). Could a static variable be used to store these?
that is exactly right, I think the root cause is the implementation of the sparseIterator, so maybe this draft PR should be more of a proof that that the |
f25f63c to
b06f01b
Compare
|
additional to-dos from a call with @favorov:
|