- java.lang.Object
-
- org.ojalgo.data.cluster.RandomClustering<T>
-
- All Implemented Interfaces:
ClusteringAlgorithm<T>
final class RandomClustering<T> extends java.lang.Object implements ClusteringAlgorithm<T>
Randomly assigns each item to one of k clusters.
-
-
Constructor Summary
Constructors Constructor Description RandomClustering(int k)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.util.List<T>centroids(java.util.Collection<T> input)java.util.List<java.util.Set<T>>cluster(java.util.Collection<T> input)Partitions the given items into clusters.
-
-
-
Method Detail
-
cluster
public java.util.List<java.util.Set<T>> cluster(java.util.Collection<T> input)
Description copied from interface:ClusteringAlgorithmPartitions the given items into clusters.- Specified by:
clusterin interfaceClusteringAlgorithm<T>- 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.
-
-