aeon
aeon copied to clipboard
[MNT] Use Numpy Vectorization in ContinuosIntervalTree fit method
Describe the issue
In ContinuosIntervalTree.fit method in classification/sklearn module, we use the following lines:
distribution = np.zeros(self.n_classes_)
for i in range(len(y)):
distribution[y[i]] += 1
Instead we could replace it by the following code and benefit from some numpy vectorization:
_, distribution = np.unique(y, return_counts=True)
Suggest a potential alternative/fix
No response
Additional context
No response
Maybe it will be my first issue. I will try.
@aeon-actions-bot assign @LinGinQiu