Skip to content

Commit 9f18426

Browse files
committed
fix bug
1 parent 32b2a7b commit 9f18426

File tree

1 file changed

+2
-2
lines changed
  • aeon/transformations/collection/channel_selection

1 file changed

+2
-2
lines changed

aeon/transformations/collection/channel_selection/_random.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class RandomChannelSelector(BaseChannelSelector):
1616
Parameters
1717
----------
1818
p: float, default 0.4
19-
proportion of channels to keep. If p*len(X) is non integer it is rounded up
19+
proportion of channels to keep. If p*n_channels is non integer it is rounded up
2020
to the nearest integer.
2121
2222
Attributes
@@ -53,7 +53,7 @@ def __init__(self, p=0.4, random_state=None):
5353
def _fit(self, X, y):
5454
"""Randomly select channels to retain."""
5555
rng = check_random_state(self.random_state)
56-
to_select = math.ceil(self.p * len(X))
56+
to_select = math.ceil(self.p * X.shape[1])
5757
self.channels_selected_ = rng.choice(
5858
list(range(X[0].shape[0])), size=to_select, replace=False
5959
)

0 commit comments

Comments
 (0)