Skip to content

scipy breakage of scikit-learn hamming distance between ... things #4014

@argriffing

Description

@argriffing

My scipy PR scipy/scipy#4293 merged to fix problems in scikit-bio is now causing a test failure in scikit-learn. I'll try to figure out the best way to fix this, probably by figuring out exactly how CLASSIFICATION_METRICS['hamming'](y1_str, y2_str, pos_label="spam") in sklearn ends up calling hamming(x, y) in scipy so that I can add a scipy regression test or possibly a sklearn PR.

======================================================================
ERROR: Ensure that classification metrics with string labels
----------------------------------------------------------------------
Traceback (most recent call last):
  /sklearn/metrics/tests/test_common.py", line 531, in test_invariance_string_vs_numbers_labels
    measure_with_str = metric_str(y1_str, y2_str)
  /sklearn/metrics/classification.py", line 1307, in hamming_loss
    return sp_hamming(y_true, y_pred)
  /scipy/spatial/distance.py", line 369, in hamming
    return np.not_equal(u, v).mean()
AttributeError: 'NotImplementedType' object has no attribute 'mean'

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