Class ClusterSampling<I extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance & org.apache.commons.math3.ml.clustering.Clusterable,​D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<I>>

  • All Implemented Interfaces:
    java.lang.Iterable<org.api4.java.algorithm.events.IAlgorithmEvent>, java.util.concurrent.Callable<D>, java.util.Iterator<org.api4.java.algorithm.events.IAlgorithmEvent>, org.api4.java.ai.ml.core.filter.unsupervised.sampling.ISamplingAlgorithm<D>, org.api4.java.algorithm.IAlgorithm<D,​D>, org.api4.java.common.control.ICancelable, org.api4.java.common.control.ILoggingCustomizable
    Direct Known Subclasses:
    GmeansSampling, KmeansSampling

    public abstract class ClusterSampling<I extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance & org.apache.commons.math3.ml.clustering.Clusterable,​D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<I>>
    extends ASamplingAlgorithm<D>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<org.apache.commons.math3.ml.clustering.CentroidCluster<I>> clusterResults  
      protected int currentCluster  
      protected org.apache.commons.math3.ml.distance.DistanceMeasure distanceMeassure  
      protected long seed  
      • Fields inherited from class ai.libs.jaicore.basic.algorithm.AAlgorithm

        logger
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ClusterSampling​(long seed, D input)  
      protected ClusterSampling​(long seed, org.apache.commons.math3.ml.distance.DistanceMeasure dist, D input)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.api4.java.algorithm.events.IAlgorithmEvent doAlgorithmStep()  
      java.util.List<org.apache.commons.math3.ml.clustering.CentroidCluster<I>> getClusterResults()  
      void setClusterResults​(java.util.List<org.apache.commons.math3.ml.clustering.CentroidCluster<I>> clusterResults)  
      void setDistanceMeassure​(org.apache.commons.math3.ml.distance.DistanceMeasure distanceMeassure)  
      • Methods inherited from class ai.libs.jaicore.basic.algorithm.AAlgorithm

        activate, announceTimeoutDetected, avoidReinterruptionOnShutdownOnCurrentThread, cancel, checkAndConductTermination, checkTermination, computeTimeoutAware, getActivationTime, getConfig, getId, getInput, getLoggerName, getNumCPUs, getRemainingTimeToDeadline, getState, getTimeout, getTimeoutPrecautionOffset, hasNext, hasThreadBeenInterruptedDuringShutdown, interruptThreadAsPartOfShutdown, isCanceled, isShutdownInitialized, isStopCriterionSatisfied, isTimeouted, iterator, next, post, registerActiveThread, registerListener, resolveShutdownInterruptOnCurrentThread, setConfig, setDeadline, setLoggerName, setMaxNumThreads, setNumCPUs, setState, setTimeout, setTimeout, setTimeoutPrecautionOffset, shutdown, terminate, unregisterActiveThread, unregisterThreadAndShutdown
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.api4.java.algorithm.IAlgorithm

        getConfig, getId, getInput, getNumCPUs, getTimeout, nextWithException, registerListener, setMaxNumThreads, setNumCPUs, setTimeout, setTimeout
      • Methods inherited from interface org.api4.java.common.control.ICancelable

        cancel
      • Methods inherited from interface java.lang.Iterable

        forEach, iterator, spliterator
      • Methods inherited from interface java.util.Iterator

        forEachRemaining, hasNext, next, remove
    • Field Detail

      • clusterResults

        protected java.util.List<org.apache.commons.math3.ml.clustering.CentroidCluster<I extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance & org.apache.commons.math3.ml.clustering.Clusterable>> clusterResults
      • currentCluster

        protected int currentCluster
      • distanceMeassure

        protected org.apache.commons.math3.ml.distance.DistanceMeasure distanceMeassure
      • seed

        protected long seed
    • Constructor Detail

      • ClusterSampling

        protected ClusterSampling​(long seed,
                                  D input)
      • ClusterSampling

        protected ClusterSampling​(long seed,
                                  org.apache.commons.math3.ml.distance.DistanceMeasure dist,
                                  D input)
    • Method Detail

      • getClusterResults

        public java.util.List<org.apache.commons.math3.ml.clustering.CentroidCluster<I>> getClusterResults()
      • setClusterResults

        public void setClusterResults​(java.util.List<org.apache.commons.math3.ml.clustering.CentroidCluster<I>> clusterResults)
      • setDistanceMeassure

        public void setDistanceMeassure​(org.apache.commons.math3.ml.distance.DistanceMeasure distanceMeassure)
      • doAlgorithmStep

        public org.api4.java.algorithm.events.IAlgorithmEvent doAlgorithmStep()
                                                                       throws org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException,
                                                                              java.lang.InterruptedException,
                                                                              org.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledException
        Throws:
        org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException
        java.lang.InterruptedException
        org.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledException