Class GmeansSamplingFactory<I extends IClusterableInstance,​D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<I>>

    • Constructor Detail

      • GmeansSamplingFactory

        public GmeansSamplingFactory()
    • Method Detail

      • setClusterSeed

        public void setClusterSeed​(long clusterSeed)
        Set the seed the clustering will use for initialization. Default is without a fix seed and the system time instead.
        Parameters:
        clusterSeed -
      • setDistanceMeassure

        public void setDistanceMeassure​(org.apache.commons.math3.ml.distance.DistanceMeasure distanceMeassure)
        Set the distance measure for the clustering. Default is the Manhattan distance.
        Parameters:
        distanceMeassure -
      • getMaxIterationsInnerLoop

        public int getMaxIterationsInnerLoop()
      • setMaxIterationsInnerLoop

        public void setMaxIterationsInnerLoop​(int maxIterationsInnerLoop)
      • getAlgorithm

        public GmeansSampling<I,​D> getAlgorithm​(int sampleSize,
                                                      D inputDataset,
                                                      java.util.Random random)
        Description copied from interface: ISamplingAlgorithmFactory
        After the necessary config is done, this method returns a fully configured instance of a sampling algorithm.
        Specified by:
        getAlgorithm in interface ISamplingAlgorithmFactory<I extends IClusterableInstance,​D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<I>>
        Parameters:
        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.
        Returns:
        Configured sampling algorithm object.