DataType
- public static class MiniBatchKMeansClusterer.Builder<DataType extends Vector>
extends java.lang.Object
MiniBatchKMeansClusterer
s without
using the big constructor.Constructor and Description |
---|
Builder(int numClusters)
Create a mini-batch k-means clusterer builder and set it to
the given number of clusters.
|
Builder(int numClusters,
Semimetric<? super Vector> metric)
Create a mini-batch k-means clusterer builder and set it to
the given number of clusters.
|
Modifier and Type | Method and Description |
---|---|
MiniBatchKMeansClusterer<DataType> |
build()
Builds the clusterer.
|
MiniBatchKMeansClusterer.Builder<DataType> |
withCreator(ClusterCreator<MiniBatchCentroidCluster,Vector> creator) |
MiniBatchKMeansClusterer.Builder<DataType> |
withInitializer(FixedClusterInitializer<MiniBatchCentroidCluster,Vector> initializer) |
MiniBatchKMeansClusterer.Builder<DataType> |
withMaxIterations(int maxIterations) |
MiniBatchKMeansClusterer.Builder<DataType> |
withMinibatchSize(int minibatchSize) |
MiniBatchKMeansClusterer.Builder<DataType> |
withNumClusters(int numClusters) |
MiniBatchKMeansClusterer.Builder<DataType> |
withRandom(java.util.Random random) |
public Builder(int numClusters)
GreedyClusterInitializer
.numClusters
- public Builder(int numClusters, Semimetric<? super Vector> metric)
GreedyClusterInitializer
, and the given metric will be used
to measure all distances.numClusters
- metric
- the semimetric to use to measure distancespublic MiniBatchKMeansClusterer<DataType> build()
public MiniBatchKMeansClusterer.Builder<DataType> withNumClusters(int numClusters)
numClusters
- the number of clusters to createpublic MiniBatchKMeansClusterer.Builder<DataType> withMaxIterations(int maxIterations)
maxIterations
- the number of iterations before stoppingpublic MiniBatchKMeansClusterer.Builder<DataType> withMinibatchSize(int minibatchSize)
minibatchSize
- the mini-batch sizeMiniBatchKMeansClusterer.setMinibatchSize(int)
public MiniBatchKMeansClusterer.Builder<DataType> withInitializer(FixedClusterInitializer<MiniBatchCentroidCluster,Vector> initializer)
initializer
- sets the initial centroidspublic MiniBatchKMeansClusterer.Builder<DataType> withCreator(ClusterCreator<MiniBatchCentroidCluster,Vector> creator)
creator
- the cluster creator to usepublic MiniBatchKMeansClusterer.Builder<DataType> withRandom(java.util.Random random)
random
- the random number generator to use