public class KmeansSamplingFactory<I extends IInstance> extends java.lang.Object implements IRerunnableSamplingAlgorithmFactory<I,KmeansSampling<I>>
| Constructor and Description |
|---|
KmeansSamplingFactory() |
| Modifier and Type | Method and Description |
|---|---|
KmeansSampling<I> |
getAlgorithm(int sampleSize,
IDataset<I> inputDataset,
java.util.Random random)
After the necessary config is done, this method returns a fully configured
instance of a sampling algorithm.
|
void |
setClusterSeed(long clusterSeed)
Set the seed the clustering will use for initialization.
|
void |
setDistanceMeassure(org.apache.commons.math3.ml.distance.DistanceMeasure distanceMeassure)
Set the distance measure for the clustering.
|
void |
setK(int k)
Set how many clusters shall be created.
|
void |
setPreviousRun(KmeansSampling<I> previousRun)
Set the previous run of the sampling algorithm, if one occurred, can be set
here to get data from it.
|
public void setPreviousRun(KmeansSampling<I> previousRun)
IRerunnableSamplingAlgorithmFactorysetPreviousRun in interface IRerunnableSamplingAlgorithmFactory<I extends IInstance,KmeansSampling<I extends IInstance>>previousRun - Algorithm object of the previous of the sampling
algorithm.public void setK(int k)
k - Parameter k of k-means.public void setClusterSeed(long clusterSeed)
clusterSeed - public void setDistanceMeassure(org.apache.commons.math3.ml.distance.DistanceMeasure distanceMeassure)
distanceMeassure - public KmeansSampling<I> getAlgorithm(int sampleSize, IDataset<I> inputDataset, java.util.Random random)
ISamplingAlgorithmFactorygetAlgorithm in interface ISamplingAlgorithmFactory<I extends IInstance,KmeansSampling<I extends IInstance>>sampleSize - Desired size of the sample that will be created.inputDataset - Dataset where the sample will be drawn from.random - Random object to make samples reproducible.