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

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

    public class GMeansStratiAmountSelectorAndAssigner<I extends INumericArrayInstance,​D extends IDataset<I>>
    extends ClusterStratiAssigner<I,​D>
    implements IStratiAmountSelector<D>
    Combined strati amount selector and strati assigner via g-means. IT can be used in 3 combinations: 1) Amount Selector and Strati Assigner: A g-means clustering is initially performed to select a strati amount via the amount of found clusters and to assign datapoints with this clusters afterwards. 2) Amount Selector: A g-means clustering is initially performed to select a suitable strati amount with the amount of found clusters. 3) Strati Assigner: Since the amount of strati is selected with another component g-means cannot be used and k-means will be used to be conform with the given strati amount. It is recommended to use combination 1, because only using this component for only one of the two tasks could yield in inconsistent results.
    • Constructor Detail

      • GMeansStratiAmountSelectorAndAssigner

        public GMeansStratiAmountSelectorAndAssigner​(int randomSeed)
        Constructor for GMeansStratiAmountSelectorAndAssigner with Manhattan distanceMeasure as a default.
        Parameters:
        randomSeed - Seed for random numbers.
      • GMeansStratiAmountSelectorAndAssigner

        public GMeansStratiAmountSelectorAndAssigner​(org.apache.commons.math3.ml.distance.DistanceMeasure distanceMeasure,
                                                     int randomSeed)
        Constructor for GMeansStratiAmountSelectorAndAssigner with custom distanceMeasure.
        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.
        Specified by:
        init in interface IStratiAssigner<I extends INumericArrayInstance,​D extends IDataset<I>>
        Parameters:
        dataset - The dataset the datapoints will be sampled from.
        stratiAmount - The predetermined amount of strati the dataset will be stratified into.