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

cca_zoo.models.GRCCA.fit's keyword-argument group should default to single-feature groups #148

Open
JohannesWiesner opened this issue Oct 7, 2022 · 2 comments

Comments

@JohannesWiesner
Copy link
Contributor

Hi James,

I want to use cca_zoo.models.GRCCA for my dataset. Both X an y can be divided into n groups. If I read the documentation correctly information on feature subsets can be provided using the groups keyword argument in the .fit() method? This keyword argument defaults to None. Just for testing purposes, I tried using .fit() without providing a value for groups to see what happens but I got this error:

File "/tmp/ipykernel_46235/3223454239.py", line 8, in <cell line: 8>
    estimator.fit([brain_df,behavior_df])

  File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes/lib/python3.9/site-packages/cca_zoo/models/_prcca.py", line 131, in fit
    views, idxs = self.preprocess(views, groups)

  File "/home/johannes.wiesner/.conda/envs/csp_wiesner_johannes/lib/python3.9/site-packages/cca_zoo/models/_prcca.py", line 145, in preprocess
    for view, group, mu, c in zip(views, groups, self.mu, self.c)

TypeError: 'NoneType' object is not iterable

It seems like you have not implemented a solution for .fit(groups=None)? Looking back at @ElenaTuzhilina's code, it seems that she wrote the code in such a way, that if not otherwise provided, each feature forms a single group. Another solution would be to simply make groups a positional argument, where the user has to provide groups. But I guess this solution would then deviate more from the original implementation.

@jameschapman19
Copy link
Owner

Thanks @JohannesWiesner - to be honest I've documented both PRCCA and GRCCA really badly sorry. Will take a look but first glance I think you're right. Think I'll go with the best/worst of both worlds and default to none with the same flow as Elena but with a warning that says it's probably a bad idea

@JohannesWiesner
Copy link
Contributor Author

Yippie, sounds good!

but with a warning that says it's probably a bad idea

Please use this exact phrase for the warning! 😂

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

No branches or pull requests

2 participants