aeon-toolkit / aeon

A toolkit for machine learning from time series
https://aeon-toolkit.org/
BSD 3-Clause "New" or "Revised" License
887 stars 94 forks source link

[BUG] Diagnostics for BasicMotions with HC2, numba stripped out #1650

Closed TonyBagnall closed 1 hour ago

TonyBagnall commented 3 weeks ago

stripped out njit to the point where it still passes locally, seems to have narrowed it down to shaplet transform

aeon-actions-bot[bot] commented 3 weeks ago

Thank you for contributing to aeon

I have added the following labels to this PR based on the title: [ $\color{#d73a4a}{\textsf{bug}}$ ]. I have added the following labels to this PR based on the changes made: [ $\color{#BCAE15}{\textsf{classification}}$, $\color{#2C2F20}{\textsf{testing}}$, $\color{#41A8F6}{\textsf{transformations}}$ ]. Feel free to change these if they do not properly represent the PR.

The Checks tab will show the status of our automated tests. You can click on individual test runs in the tab or "Details" in the panel below to see more information if there is a failure.

If our pre-commit code quality check fails, any trivial fixes will automatically be pushed to your PR unless it is a draft.

Don't hesitate to ask questions on the aeon Slack channel if you have any.

TonyBagnall commented 3 weeks ago

after this the next stage is ShapeletTransform

_extract_random_shapelet (not njit) @njit methods z_normalise_series _find_shapelet_quality _online_shapelet_distance (this has a bespoke std calculation that calls math.sqrt. It also calls zip) _calc_early_binary_ig _binary_entropy _calc_binary_ig _binary_entropy

whats weird to me is if I turn numba off on the outermost method, _find_shapelet_quality, it crashes,

 File "C:\Code\aeon\aeon\transformations\collection\base.py", line 327, in _fit_transform
    self._fit(X, y)
  File "C:\Code\aeon\aeon\transformations\collection\shapelet_based\_shapelet_transform.py", line 297, in _fit
    candidate_shapelets = Parallel(
  File "C:\Code\aeon\venv\lib\site-packages\joblib\parallel.py", line 1918, in __call__
    return output if self.return_generator else list(output)
  File "C:\Code\aeon\venv\lib\site-packages\joblib\parallel.py", line 1847, in _get_sequential_output
    res = func(*args, **kwargs)
  File "C:\Code\aeon\aeon\transformations\collection\shapelet_based\_shapelet_transform.py", line 446, in _extract_random_shapelet
    quality = self._find_shapelet_quality(
  File "C:\Code\aeon\aeon\transformations\collection\shapelet_based\_shapelet_transform.py", line 513, in _find_shapelet_quality
    quality = _calc_binary_ig(orderline, this_cls_count, other_cls_count)
TypeError: can't unbox heterogeneous list: UniTuple(int64 x 2) != Tuple(float64, int64)

logically, I thought you should be able to turn off the outer methods

TonyBagnall commented 3 weeks ago

so seems ST is the culprit.