-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MAINT Parameters validation for covariance.oas
#24904
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
Conversation
It looks good. codecov is complaining. It could be the right time to add the missing test to be sure that we raise the warning properly and cover the lines. |
Hi @glemaitre , thank you for the review. I've some doubts when i was writing unit test for the changes. Please let me know if the comments highlighted above makes sense. I'll modify the code according to your response :) |
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
X = X - X.mean() | ||
return np.atleast_2d((X**2).mean()), 0.0 | ||
|
||
n_samples, n_features = X.shape |
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.
I removed the following check as this is moved inside the class
::Removed::
- if X.ndim == 1:
- n_samples = 1
- n_features = X.size
- else:
- n_samples, n_features = X.shape
::Addition::
+ n_samples, n_features = X.shape
Please let me know if this is okay.
Hi @glemaitre , some checks are failing and I think this is because we are now allowing 1d arrays to be passed and not raising Value error which was the existing behaviour (commit - 63cc0b6). Please let me know if any changes needs to be done, I'll do it. |
Hi @glemaitre , I've fixed the ci errors :) |
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.
LGTM. Thanks @raghuveerbhat
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> Co-authored-by: jeremiedbb <jeremiedbb@yahoo.fr>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> Co-authored-by: jeremiedbb <jeremiedbb@yahoo.fr>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com> Co-authored-by: jeremiedbb <jeremiedbb@yahoo.fr>
Reference Issues/PRs
Towards #24862
Also linked to #24868
What does this implement/fix? Explain your changes.
Refactor
covariance.oas
as parameter validation is happening inside theOAS
class.Any other comments?
I think 1d arrays for
X
is deprecated. If that is indeed the case then maybe I can remove theX.ndim == 1
check in_oas()
.