Class KMeansStratiAssigner

  • All Implemented Interfaces:
    IStratiAssigner, org.api4.java.common.control.IParallelizable

    public class KMeansStratiAssigner
    extends ClusterStratiAssigner
    Cluster the data set with k-means into k Clusters, where each cluster stands for one stratum. The datapoint assignment is performed with a lookup in the clusters.
    • Constructor Detail

      • KMeansStratiAssigner

        public KMeansStratiAssigner​(org.apache.commons.math3.ml.distance.DistanceMeasure distanceMeasure,
                                    int randomSeed)
        Constructor for KMeansStratiAssigner.
        Parameters:
        distanceMeasure - Distance measure for datapoints, for example Manhattan or Euclidian.
        randomSeed - Seed for random numbers.
    • Method Detail

      • init

        public void init​(org.api4.java.ai.ml.core.dataset.IDataset<?> dataset,
                         int stratiAmount)
        Description copied from interface: IStratiAssigner
        Initialize custom assigner if necessary.
        Parameters:
        dataset - The dataset the datapoints will be sampled from.
        stratiAmount - The predetermined amount of strati the dataset will be stratified into.