-
Notifications
You must be signed in to change notification settings - Fork 228
[MRG] Adding fit_transform #26
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
[MRG] Adding fit_transform #26
Conversation
I think what I've currently done is a bit verbose - maybe just a -
would be better? |
I think you might be able to define a generic def fit_transform(self, *args, **kwargs):
self.fit(*args, **kwargs)
return self.transform() Some subclasses might need special treatment, but that should be a good start. We'll also want to add a test case for each algorithm's subclass. |
@perimosocordiae which subclasses might need special treatment? I made the change and tried it out on all the algorithms and it seems fine. Should the test format be similar to what is already done in |
The docstring needs some work. Maybe just describe the function as calling For testing, it would be nice to have a simple loop that checks the result of calling |
Funnily enough, tests fail for edit: i'll change the specifics of the tests; this is just a rough outline of what they might look like. |
The test failures look like a random seed issue, though I haven't verified on my end. |
How do you suggest getting around the random seed issue? Can I pass a seed to the algorithm; or would declaring it outside before running |
@perimosocordiae could you please help verify the source of the errors?
|
I made a new issue (#33) for your first point. RCA is affected by the same issue because the LFDA is based on an eigen decomposition and eigenvectors are sign-invariant, so that's why you're seeing the sign flipping. Both |
Thanks - this answers everything I wanted to know. Will get to this over the weekend. |
@perimosocordiae , for some reason despite the passing of |
Thought I would fix it by adding parameters for random_state in the |
ping @perimosocordiae could you have a look please? |
You need to reset the random state between the two times you use it (in the |
Ah, okay. The tests are fixed now. |
@perimosocordiae , could you see if this is fine? |
Looks good, thanks! |
@perimosocordiae , could you have a look and see if this is the correct idea/direction to go in?
And this sort of
fit_transform
would be wanted for all the algorithms, correct?This is with respect to #25.