Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add **kwargs to sklearn.multiclass.(OneVsOne,OneVsRest).fit(X,y) #11956

@azrdev

Description

@azrdev

Description

I'm implementing a binary classifier. To support multi-class problems, I copied the approach from Gaussian process classification: if n_classes > 2, wrap the binary classifier in a OneVsOneClassifier or OneVsRestClassifier.

However, this is incompatible with me adding additional arguments to fit(), because the wrappers don't forwards these arguments to the wrapped binary classifier.

AIUI the fix would be to change all fit(X, y) methods in sklearn.multiclass to fit(X, y, **kwargs), and pass that new argument to the wrapped.fit(X, y, **kwargs) call.

Should I simply create a merge request, or am I missing something?

Versions

Linux-4.18.5-arch1-1-ARCH-x86_64-with-arch
Python 3.7.0 (default, Jul 15 2018, 10:44:58) 
[GCC 8.1.1 20180531]
NumPy 1.15.0
SciPy 1.1.0
Scikit-Learn 0.19.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions