Class CaseControlLikeSampling<D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>>

  • 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:
    APilotEstimateSampling

    public abstract class CaseControlLikeSampling<D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>>
    extends ASamplingAlgorithm<D>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<ai.libs.jaicore.basic.sets.Pair<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,​java.lang.Double>> acceptanceThresholds  
      protected java.util.Random rand  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.util.List<ai.libs.jaicore.basic.sets.Pair<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,​java.lang.Double>> computeAcceptanceThresholds()  
      protected java.util.HashMap<java.lang.Object,​java.lang.Integer> countClassOccurrences​(D dataset)
      Count occurrences of every class.
      java.util.List<ai.libs.jaicore.basic.sets.Pair<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,​java.lang.Double>> getAcceptanceThresholds()  
      java.lang.String getLoggerName()  
      org.api4.java.algorithm.events.IAlgorithmEvent nextWithException()  
      void setAcceptanceTresholds​(java.util.List<ai.libs.jaicore.basic.sets.Pair<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,​java.lang.Double>> thresholds)  
      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
    • Field Detail

      • rand

        protected java.util.Random rand
      • acceptanceThresholds

        protected java.util.List<ai.libs.jaicore.basic.sets.Pair<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,​java.lang.Double>> acceptanceThresholds
    • Constructor Detail

      • CaseControlLikeSampling

        protected CaseControlLikeSampling​(D input)
    • Method Detail

      • getAcceptanceThresholds

        public java.util.List<ai.libs.jaicore.basic.sets.Pair<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,​java.lang.Double>> getAcceptanceThresholds()
      • setAcceptanceTresholds

        public void setAcceptanceTresholds​(java.util.List<ai.libs.jaicore.basic.sets.Pair<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,​java.lang.Double>> thresholds)
      • computeAcceptanceThresholds

        public abstract java.util.List<ai.libs.jaicore.basic.sets.Pair<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,​java.lang.Double>> computeAcceptanceThresholds()
                                                                                                                                                                                  throws ThresholdComputationFailedException,
                                                                                                                                                                                         java.lang.InterruptedException,
                                                                                                                                                                                         org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException,
                                                                                                                                                                                         org.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledException,
                                                                                                                                                                                         org.api4.java.algorithm.exceptions.AlgorithmException
        Throws:
        ThresholdComputationFailedException
        java.lang.InterruptedException
        org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException
        org.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledException
        org.api4.java.algorithm.exceptions.AlgorithmException
      • nextWithException

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

        protected java.util.HashMap<java.lang.Object,​java.lang.Integer> countClassOccurrences​(D dataset)
        Count occurrences of every class. Needed to determine the probability for all instances of that class
        Parameters:
        dataset - Dataset of the sample algorithm object
        Returns:
        HashMap of occurrences
        Throws:
        java.lang.ClassNotFoundException
      • 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.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>>
      • 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.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>>