Skip to content

sklearn .fit method incorrectly applies arg max #2808

Description

@simplymathematics

Describe the bug
The ScikitlearnClassifier.fit method incorrectly applies argmax when y_labels are already a single column.

The method applies np.argmax without checking the shape.

To Reproduce
Steps to reproduce the behavior:
art_model = SciKitlearnClassifier().fit(X, y=[0,0,0,0,1,1,1,1,1])

Expected behavior
Only apply np.argmax if ndim > 1.

Screenshots
If applicable, add screenshots to help explain your problem.

System information (please complete the following information):
https://github.com/Trusted-AI/adversarial-robustness-toolbox/blob/main/art/estimators/classification/scikitlearn.py

In the current main branch.

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