Correcting OneClassSVM.fit() Signature#11933
Correcting OneClassSVM.fit() Signature#11933raamana wants to merge 4 commits intoscikit-learn:masterfrom
Conversation
|
I should have discussed this with the maintainers first before opening the PR, but I was convinced this was a clear mistake that needs to be corrected ;) Anyways, after looked further into tests, I realize sklearn tests mandate taking I think we should improve the definition for scikit-learn/sklearn/utils/estimator_checks.py Lines 1051 to 1075 in 8d7ce8e and remove this |
|
For good or bad we have established this convention, and I see little
benefit in changing it.
|
|
Well, the biggest benefit is to reduce user's confusion of when trying to use |
|
That will break existing meta-estimator code, perhaps inside but certainly outside this resistor. So while we could deprecate the convention, I see little benefit, while this is the convention we establish long ago. Missing from the OneClassSVM case is the documentation |
|
I understand your practical concerns - could you elaborate on how you think this will break the meta-estimator code? Also, I am not following you on the "inside" vs "outside" parts you mention. That's likely why I am underestimating how impactful these changes are. I'd be curious to learn more. while Of course, final call is up to the sklearn dev and maintainer team, and I'd be happy update the PR with that. |
|
Also, as far as I can check IsolationForest and ElliptivEnvelope are both not doing any better than OneClassSVM: scikit-learn/sklearn/ensemble/iforest.py Line 190 in 8d7ce8e |
|
Elsewhere in the unsupervised scikit-learn world: |
|
Meta-estimators naturally call We're just not going to change this. Please do submit a PR documenting that y is ignored. |
What does this implement/fix? Explain your changes.
The signature of
OneClassSVM.fit()method has an unexpectedy=Nonein its signature, although its not being used or documented under Parameters. Moreoverkwargscapturing is unncessary as its not documented or expected, and super-class method doesn't take them anyways.Any other comments?
Perhaps this was a design decision to try match the signatures in
BaseLibSVMclass, but I don't think this is a good idea.