Class StratifiedSampling<D extends org.api4.java.ai.ml.core.dataset.IDataset<?>>

  • 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, org.api4.java.common.event.IEventEmitter<java.lang.Object>, org.api4.java.common.event.IRelaxedEventEmitter
    Direct Known Subclasses:
    LabelBasedStratifiedSampling

    public class StratifiedSampling<D extends org.api4.java.ai.ml.core.dataset.IDataset<?>>
    extends ASamplingAlgorithm<D>
    Implementation of Stratified Sampling: Divide dataset into strati and sample from each of these.
    • Constructor Summary

      Constructors 
      Constructor Description
      StratifiedSampling​(IStratifier stratificationTechnique, java.util.Random random, D input)
      Constructor for Stratified Sampling.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getLoggerName()  
      org.api4.java.algorithm.events.IAlgorithmEvent nextWithException()  
      void setLoggerName​(java.lang.String loggername)  
      • Methods inherited from class ai.libs.jaicore.basic.algorithm.AAlgorithm

        activate, announceTimeoutDetected, avoidReinterruptionOnShutdownOnCurrentThread, cancel, checkAndConductTermination, checkTermination, computeTimeoutAware, getActivationTime, getConfig, getDeadline, getId, getInput, getListeners, getNumCPUs, getRemainingTimeToDeadline, getState, getTimeout, getTimeoutPrecautionOffset, hasNext, hasThreadBeenInterruptedDuringShutdown, interruptThreadAsPartOfShutdown, isCanceled, isShutdownInitialized, isStopCriterionSatisfied, isTimeoutDefined, isTimeouted, iterator, next, post, registerActiveThread, registerListener, resolveShutdownInterruptOnCurrentThread, setConfig, setDeadline, 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, 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
    • Constructor Detail

      • StratifiedSampling

        public StratifiedSampling​(IStratifier stratificationTechnique,
                                  java.util.Random random,
                                  D input)
        Constructor for Stratified Sampling.
        Parameters:
        stratiAmountSelector - The custom selector for the used amount of strati.
        stratiAssigner - Custom logic to assign datapoints into strati.
        random - Random object for sampling inside of the strati.
    • Method Detail

      • nextWithException

        public org.api4.java.algorithm.events.IAlgorithmEvent nextWithException()
                                                                         throws java.lang.InterruptedException,
                                                                                org.api4.java.algorithm.exceptions.AlgorithmException,
                                                                                org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException,
                                                                                org.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledException
        Throws:
        java.lang.InterruptedException
        org.api4.java.algorithm.exceptions.AlgorithmException
        org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException
        org.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledException
      • setLoggerName

        public void setLoggerName​(java.lang.String loggername)
        Specified by:
        setLoggerName in interface org.api4.java.common.control.ILoggingCustomizable
        Overrides:
        setLoggerName in class ASamplingAlgorithm<D extends org.api4.java.ai.ml.core.dataset.IDataset<?>>
      • getLoggerName

        public java.lang.String getLoggerName()
        Specified by:
        getLoggerName in interface org.api4.java.common.control.ILoggingCustomizable
        Overrides:
        getLoggerName in class ASamplingAlgorithm<D extends org.api4.java.ai.ml.core.dataset.IDataset<?>>