Skip to content

partial_fit should raise an error when y in each batch contains labels not present in classes_ #6203

@MechCoder

Description

@MechCoder
X_first = rng.randn(5, 2)
ovr = OneVsRestClassifier(SGDClassifier())
ovr.partial_fit(X_first, [2, 0, 0, 1, 0], [0, 1, 2])
ovr.partial_fit(X_first, [3, 4, 4, 2, 3])

This is the problem with the base estimator as well

sgd = SGDClassifier()
sgd.partial_fit(X_first, [2, 0, 0, 1, 0], [0, 1, 2])
sgd.partial_fit(X_first, [3, 4, 4, 2, 3])

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions