Customization and Composition

Components

Each of the above components — trees, hierarchies, and partitioning strategies — can be independently selected and composed. This enables flexible experimentation and tailored clustering behavior for a wide range of data types and analysis goals.

Example:

from SHiP import SHiP
from SHiP.ultrametric_tree import UltrametricTreeType
from SHiP.partitioning import PartitioningMethod

ship = SHiP(data=my_data, treeType=UltrametricTreeType.DCTree)
labels = ship.fit_predict(hierarchy=2, partitioningMethod=PartitioningMethod.Elbow)