Skip to content

BUG OneVsRestClassifier doesn't play nicely with SVC #1946

Closed
@larsmans

Description

@larsmans

Reported at SO:

classifier = OneVsRestClassifier(SVC(class_weight='auto'))
classifier.fit(X1, y1)
y2 = classifier.predict(X2)

raises an exception because SVC.predict_proba doesn't actually work unless probability=True is passed.

Suggested fix: refactor the SVM code to introduce a new class, PlattSVC, that functions like SVC(probability=True) except that it uses probabilities for predict and decision_function also. Remove predict_proba from SVC. That would immediately fix the problem that SVC.predict_proba is inconsistent with decision_function and predict.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugModerateAnything that requires some knowledge of conventions and best practices

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions