public class KMeansTrainer extends Object implements SingleLabelDatasetTrainer<KMeansModel>
| Constructor and Description |
|---|
KMeansTrainer() |
| Modifier and Type | Method and Description |
|---|---|
<K,V> KMeansModel |
fit(DatasetBuilder<K,V> datasetBuilder,
IgniteBiFunction<K,V,double[]> featureExtractor,
IgniteBiFunction<K,V,Double> lbExtractor)
Trains model based on the specified data.
|
DistanceMeasure |
getDistance()
Gets the distance.
|
double |
getEpsilon()
Gets the epsilon.
|
int |
getK()
Gets the amount of clusters.
|
int |
getMaxIterations()
Gets the max number of iterations before convergence.
|
long |
getSeed()
Gets the seed number.
|
KMeansTrainer |
withDistance(DistanceMeasure distance)
Set up the distance.
|
KMeansTrainer |
withEpsilon(double epsilon)
Set up the epsilon.
|
KMeansTrainer |
withK(int k)
Set up the amount of clusters.
|
KMeansTrainer |
withMaxIterations(int maxIterations)
Set up the max number of iterations before convergence.
|
KMeansTrainer |
withSeed(long seed)
Set up the seed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfit, fitpublic <K,V> KMeansModel fit(DatasetBuilder<K,V> datasetBuilder, IgniteBiFunction<K,V,double[]> featureExtractor, IgniteBiFunction<K,V,Double> lbExtractor)
fit in interface DatasetTrainer<KMeansModel,Double>K - Type of a key in upstream data.V - Type of a value in upstream data.datasetBuilder - Dataset builder.featureExtractor - Feature extractor.lbExtractor - Label extractor.public int getK()
public KMeansTrainer withK(int k)
k - The parameter value.public int getMaxIterations()
public KMeansTrainer withMaxIterations(int maxIterations)
maxIterations - The parameter value.public double getEpsilon()
public KMeansTrainer withEpsilon(double epsilon)
epsilon - The parameter value.public DistanceMeasure getDistance()
public KMeansTrainer withDistance(DistanceMeasure distance)
distance - The parameter value.public long getSeed()
public KMeansTrainer withSeed(long seed)
seed - The parameter value.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.5.0 Release Date : May 23 2018