Skip to content

[ENH] Possible unnecessary scikit-learn dependency in elastic_som.py #3231

@Lucky-Lodhi2004

Description

@Lucky-Lodhi2004

Describe the feature or idea you want to propose

In /clustering/_elastic_som.py , scikit-learn has been imported only for check_random_state method.

import numpy as np
from numpy.random import RandomState
from sklearn.utils.random import check_random_state

from aeon.clustering.base import BaseClusterer
from aeon.distances import get_alignment_path_function, pairwise_distance

This adds extra scikit-learn dependency. aeon codebase generally avoids calling scikit-learn methods directly, and uses own implementation rather. So this import looks redundant.

Describe your proposed solution

Remove scikit-learn import and implement a numpy based _check_random_state method. aeon generally uses numpy-pandas methods directly in its codebase so this implementation seems reasonable.

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature, improvement request or other non-bug code enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions