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] BaseCollectionEstimator _check_X does not raise an error for different number of channels #1888

Closed
MatthewMiddlehurst opened this issue Aug 2, 2024 · 4 comments
Assignees
Labels
bug Something isn't working testing Testing related issue or pull request

Comments

@MatthewMiddlehurst
Copy link
Member

Describe the bug

_check_X checks whether a data collection is valid, but does not catch datasets which have a different number of channels for each case which is unsupported.

Steps/Code to reproduce the bug

import numpy as np
import pytest
from aeon.base import BaseCollectionEstimator

dummy = BaseCollectionEstimator()
all_tags = {
    "capability:multivariate": True,
    "capability:unequal_length": True,
    "capability:missing_values": True,
}
dummy.set_tags(**all_tags)
X = [np.random.random(size=(2, 10)), np.random.random(size=(3, 10))]
with pytest.raises(Exception):
    dummy._check_X(X)

Expected results

An informative exception is rasied.

Actual results

No exception is raised.

Versions

No response

@MatthewMiddlehurst MatthewMiddlehurst added bug Something isn't working testing Testing related issue or pull request labels Aug 2, 2024
@Cyril-Meyer
Copy link
Contributor

Cyril-Meyer commented Aug 2, 2024

@aeon-actions-bot assign @Cyril-Meyer

@MatthewMiddlehurst I got some questions you may have answers to :

  1. Currently, the function getting the number of chan is get_n_channels which "return the number of timepoints channels in the first element of a collectiom". get_n_channels is used here and here.
    Can we transform this function with a parameters like get_n_channels(X, onlyFirst=True) to have the hability to get list of channels ?

  2. _check_X is the function which is supposed to check input, but _get_X_metadata (called by _check_X) is the function calling effectively get_n_channels. Can we raise the exception from here ? (note that it is also used in _convert_X)

  3. I've found multiple reference to aeon.registry.COLLECTIONS_DATA_TYPES in the doc, and replaced them with aeon.utils.registry.COLLECTIONS_DATA_TYPES as that's where I founded them.
    We may want to create an issue about this ? Was it a mistake from me ?

PS : when I ask "can we", it is to be understood as : "is it a good idea ?"

@MatthewMiddlehurst
Copy link
Member Author

@Cyril-Meyer

  1. I think your merged resolution is fine. We don't support different number of channels, so just raising an error instead of adding a parameter is ok.
  2. It will go through _check_X first, as long as the error is informative so the user knows what the issue is I'm ok with it going wherever, I think that has been achieved.
  3. Thanks for the fixes 🙂. Probably don't need an issue unless you know there are more that still need to be fixed.

@MatthewMiddlehurst MatthewMiddlehurst removed their assignment Aug 6, 2024
@TonyBagnall
Copy link
Contributor

looks like #1895 fixed this, can we close @Cyril-Meyer ?

@Cyril-Meyer
Copy link
Contributor

looks like #1895 fixed this, can we close @Cyril-Meyer ?

I think we can if @MatthewMiddlehurst approve 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working testing Testing related issue or pull request
Projects
None yet
Development

No branches or pull requests

3 participants