-
Notifications
You must be signed in to change notification settings - Fork 20
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
Modifications to PCovR #98
Modifications to PCovR #98
Conversation
… metrics to be maximized
…o feat/pcovr_improvements
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.
Generally looks good, but I have a design question: why use the name regressor
opposed to the sklearn-style estimator
?
|
Okay! I just wanted to make sure there was a concrete reason for doing so |
…o feat/pcovr_improvements
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.
Letting it get one more pass from @Luthaf before we merge, but looks ready to me!
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.
The code looks god overall! I have one small request =)
UC = UC.T[:, (vC ** 2) > rcond] | ||
vC = vC[(vC ** 2) > rcond] |
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.
Could you add a test hitting this code path? Even something simple with toy X/Y matrices.
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.
@bhelfrecht, codecov is still not seeing these lines in the coverage report, which is really weird since you explicitly seeded the rng ... Maybe different version of numpy have different RNG? CI is using numpy == 1.20.2.
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.
Just fixed it -- there was a typo in the test that made it bypass the targeted code
Could you try to rebase & cleanup the git history? I can help to do this if you want! |
I think I've got it, depends how messy it gets. How "clean" should it be? For starters, I assume all the silly "Formatting" |
Why not just |
Perfect, will do. |
If we go for a squash merge on the github side, there is no need to spend time doing fixup, since everything will be a single commit anyway. |
|
When we |
This PR is for a few tweaks to PCovR to address a few issues, namely #83 and #81, and to clean up the fitting.
alpha
parameter, since it didn't seem to ever get passed to the regressor. Instead, one just instantiates PCovR with ansklearn
linear regression or ridge object.Yhat
andW
parameters have been removed fromfit
, since this can be achieved by instantiating PCovR with a fitted regressor, which also ensures thatYhat
is consistent withW
, which was not the case before._fit_sample_space
has been made consistent with that in_fit_feature_space
, that is, the inverse singular values are set to zero if the corresponding singular values are less thantol
KPCovR should also be modified to use this "bring your own regressor" initialization, and all
fit
calls for PCovR-related objects should probably use lowercase y to be consistent with sklearn. These future improvements could be rolled into this PR or given their own.