Package org.ddogleg.clustering.kmeans
Class StandardKMeans_MT<P>
java.lang.Object
org.ddogleg.clustering.kmeans.StandardKMeans<P>
org.ddogleg.clustering.kmeans.StandardKMeans_MT<P>
- All Implemented Interfaces:
ComputeClusters<P>
Concurrent implementation of StandardKMeans
-
Field Summary
Fields inherited from class org.ddogleg.clustering.kmeans.StandardKMeans
convergeTol, maxIterations, maxReSeed, reseedAfterIterations, seedSelector, updateMeans
-
Constructor Summary
ConstructorDescriptionStandardKMeans_MT
(ComputeMeanClusters<P> updateMeans, InitializeKMeans<P> seedSelector, PointDistance<P> distancer, DogLambdas.NewInstance<P> factory) Configures k-means parameters -
Method Summary
Modifier and TypeMethodDescriptionprotected int
findBestMatch
(P p, DogArray<P> clusters, StandardKMeans_MT<P>.org.ddogleg.clustering.kmeans.StandardKMeans_MT.MatchData match) Searches for this cluster which is the closest to pprotected void
matchPointsToClusters
(LArrayAccessor<P> points, DogArray<P> clusters) Finds the cluster which is the closest to each point.Creates a new instance which has the same configuration and can be run in parallel.Methods inherited from class org.ddogleg.clustering.kmeans.StandardKMeans
findBestMatch, getAssignment, getDistanceMeasure, initialize, process, setVerbose
-
Constructor Details
-
StandardKMeans_MT
public StandardKMeans_MT(ComputeMeanClusters<P> updateMeans, InitializeKMeans<P> seedSelector, PointDistance<P> distancer, DogLambdas.NewInstance<P> factory) Configures k-means parameters- Parameters:
seedSelector
- Used to select initial seeds for the clusters
-
-
Method Details
-
matchPointsToClusters
Finds the cluster which is the closest to each point. The point is the added to the sum for the cluster and its member count incremented- Overrides:
matchPointsToClusters
in classStandardKMeans<P>
-
findBestMatch
protected int findBestMatch(P p, DogArray<P> clusters, StandardKMeans_MT<P>.org.ddogleg.clustering.kmeans.StandardKMeans_MT.MatchData match) Searches for this cluster which is the closest to p -
newInstanceThread
Description copied from interface:ComputeClusters
Creates a new instance which has the same configuration and can be run in parallel. Some components can be shared as long as they are read only and thread safe.- Specified by:
newInstanceThread
in interfaceComputeClusters<P>
- Overrides:
newInstanceThread
in classStandardKMeans<P>
-