Interface ClusteringAlgorithm<T>
- Type Parameters:
T- The element type being clustered.
- All Known Implementing Classes:
AutomaticClusterer, FeatureBasedClusterer, GeneralisedKMeans, GreedyClusterer, GreedyClustering, KMeansClusterer, RandomClustering, SpectralClusterer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy interface for clustering algorithms.
Implementations partition a collection of items into disjoint, non-empty clusters. Each cluster is
represented as a Set<T> containing the items assigned to that cluster; the result of
cluster(Collection) is a List<Set<T>> with one set per cluster. Unless otherwise stated by
a specific implementation, the following apply:
- Each input item appears in exactly one cluster (no overlap). - The order of clusters and the order of items within a cluster are unspecified.
- The result contains no empty clusters.
- Implementations may be deterministic or randomized and may impose additional preconditions on the input.
-
Method Summary
-
Method Details
-
cluster
Partitions the given items into clusters.- Parameters:
input- The items to cluster; must not benull. May be empty.- Returns:
- A list of clusters; each element of the list is a
Set<T>representing one cluster and containing its members. Sets are non-empty and pairwise disjoint; ordering is unspecified. - Throws:
IllegalArgumentException- If implementation-specific preconditions are violated.
-