Open JohannesWiesner opened 1 year ago
Looks like a scaling thing a bit like #162 - the correlations of the weights are >0.90 or higher. I'm pushing an update that will ensure that for cca_zoo models wXXw=n where n is the number of samples.
putting weights on the same scale
Would be good to get a bit closer though I'll take another look at the implementation.
ok think I've found the source of the error. Will let you know the results soon.
OK the source of this is basically a misalignment between RCCA lambda and cca_zoo c.
lambda gets added to the covariance matrices but c slides between 0 regularisation and 1 maximal regularisation (all ones on the diagonal).
Would it make sense to include a testing folder somewhere in cca_zoo that checks original R-implementations against cca_zoos doppelgängers? I noticed that it's actually quite handy to just be able to import R-packages with RCCA = importr('RCCA')
. Let me know if you're interested. I don't know anything about CI, but at least some folders for semi-automatic tests maybe?
Yeah definitely! Will almost certainly add this one in somewhere. Obviously there's some sharp edges (e.g. here where the parameterizations don't quite match) but no harm in having them
I've used variants of your script to check that the source of the difference is lambda/c and convinced myself.
PRCCA with no regularisation (and fewer features than samples) everything matches
GRCCA with very high regularisation also matches
GRCCA with no regularisation doesn't match but it is because of line 91 in https://github.com/ElenaTuzhilina/RCCA/blob/master/R/GRCCA.R where PRCCA is called with lambda=1 regardless of what the user inputs. This means it's not really possible to match cca_zoo and RCCA up in this instance. It seems a bit odd that they do this I think it's possible its a bug in RCCA.
Yeah definitely! Will almost certainly add this one in somewhere. Obviously, there's some sharp edges (e.g. here where the parameterizations don't quite match) but no harm in having them
Let me know if I can help with a PR!
GRCCA with no regularisation doesn't match but it is because of line 91 in https://github.com/ElenaTuzhilina/RCCA/blob/master/R/GRCCA.R where PRCCA is called with lambda=1 regardless of what the user inputs. This means it's not really possible to match cca_zoo and RCCA up in this instance. It seems a bit odd that they do this I think it's possible its a bug in RCCA.
Ah okay. Do you still have to update cca_zoo.models.GRCCA
then or is the deviation purely stemming from this bug?
Hi James, similar to #107, I implemented a test to check if
cca_zoo.models.GRCCA
gives similar results as the original implementation. But the feature weights are quite dissimilar especially for the much smallery
input array:Here's the testing code: