Class KMeansStratiAssigner<I extends INumericArrayInstance,​D extends IDataset<I>>

  • All Implemented Interfaces:
    IStratiAssigner<I,​D>

    public class KMeansStratiAssigner<I extends INumericArrayInstance,​D extends IDataset<I>>
    extends ClusterStratiAssigner<I,​D>
    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 Summary

      Constructors 
      Constructor Description
      KMeansStratiAssigner​(org.apache.commons.math3.ml.distance.DistanceMeasure distanceMeasure, int randomSeed)
      Constructor for KMeansStratiAssigner.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void init​(D dataset, int stratiAmount)
      Initialize custom assigner if necessary.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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​(D 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.