public final class KMeansUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkUniqueIDs(Collection<ClusterInfo> clusters) |
static Pair<ClusterInfo,Double> |
closestCluster(List<ClusterInfo> clusters,
DistanceFn<double[]> distanceFn,
double[] vector) |
static double[] |
featuresFromTokens(String[] data,
InputSchema inputSchema) |
public static Pair<ClusterInfo,Double> closestCluster(List<ClusterInfo> clusters, DistanceFn<double[]> distanceFn, double[] vector)
clusters - all clustersdistanceFn - distance function between clustersvector - point to measure distance topublic static double[] featuresFromTokens(String[] data, InputSchema inputSchema)
data - tokenized inputinputSchema - input schema to apply to inputpublic static void checkUniqueIDs(Collection<ClusterInfo> clusters)
clusters - clusters to check the IDs ofIllegalArgumentException - if any ClusterInfo.getID() is duplicatedCopyright © 2014–2018. All rights reserved.