Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Incorrect use of np.min in function histogram_intersection #2143

Closed
TonyBagnall opened this issue Oct 5, 2024 · 1 comment · Fixed by #2144 or #2166
Closed

[BUG] Incorrect use of np.min in function histogram_intersection #2143

TonyBagnall opened this issue Oct 5, 2024 · 1 comment · Fixed by #2144 or #2166
Assignees
Labels
bug Something isn't working classification Classification package

Comments

@TonyBagnall
Copy link
Contributor

Describe the bug

found when writing coverage testing, calls to histogram_intersection in TemporalDictionaryEnsemble throw an error due to the use of np.min instead of np.minimum, probably some numpy change some time back

Steps/Code to reproduce the bug

import numpy as np
from aeon.classification.dictionary_based._tde import histogram_intersection
first = np.array([1,0,0,1,0])
second = np.array([1,2,3,5,10])
histogram_intersection(first,second)

Expected results

expected value is 2.

Actual results

    histogram_intersection(first,second)
  File "C:\Code\aeon\aeon\classification\dictionary_based\_tde.py", line 1023, in histogram_intersection
    [
  File "C:\Code\aeon\aeon\classification\dictionary_based\_tde.py", line 1024, in <listcomp>
    0 if first[n] == 0 else np.min(first[n], second[n])
  File "C:\Code\aeon\venv\lib\site-packages\numpy\core\fromnumeric.py", line 2953, in min
    return _wrapreduction(a, np.minimum, 'min', axis, None, out,
  File "C:\Code\aeon\venv\lib\site-packages\numpy\core\fromnumeric.py", line 86, in _wrapreduction
    return reduction(axis=axis, out=out, **passkwargs)
  File "C:\Code\aeon\venv\lib\site-packages\numpy\core\_methods.py", line 45, in _amin
    return umr_minimum(a, axis, None, out, keepdims, initial, where)
numpy.exceptions.AxisError: axis 1 is out of bounds for array of dimension 0

Versions

No response

@TonyBagnall TonyBagnall added bug Something isn't working classification Classification package labels Oct 5, 2024
@TonyBagnall TonyBagnall self-assigned this Oct 5, 2024
@TonyBagnall TonyBagnall changed the title [BUG] Incorrect use of np.min in function [BUG] Incorrect use of np.min in function histogram_intersection Oct 5, 2024
@TonyBagnall
Copy link
Contributor Author

also an issue with the ordinal version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working classification Classification package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant