Skip to content

Sklearn 1.9 is not compatible with ZeroShotClassification #4784

Description

@Samoed

Describe the bug

Changes that break zeroshot classification that passed labels as strings mostly

Fix metrics.accuracy_score, metrics.hamming_loss metrics.zero_one_loss, metrics.matthews_corrcoef and metrics.confusion_matrix (when labels is not None) now raise an error when y_true is string and y_pred is numeric, for all array-like inputs. Previously, lists and numpy arrays not of object dtype did not raise an error for this mixed input case. The above metrics will also raise an error for label indicator matrix inputs of inconsistent size, except for metrics.confusion_matrix which does not accept label indicator matrix inputs. By Lucy Liu. #33086 https://scikit-learn.org/stable/whats_new/v1.9.html#sklearn-metrics

To reproduce

Run any zeroshot

Additional information

No response

Are you interested to contribute a fix for this bug?

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions