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

  • Type Parameters:
    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, org.api4.java.common.event.IEventEmitter<java.lang.Object>, org.api4.java.common.event.IRelaxedEventEmitter

    public class ClassifierWeightedSampling<D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>>
    extends APilotEstimateSampling<D>
    The idea behind this Sampling method is to weight instances depended on the way a pilot estimator p classified them. Instances that p classified right but was unsure contain the most information and are most likely to be chosen. Instances that p is very sure about and Instances that p is quite sure about their actual class and classified them falsely, are medium likely to be chosen. Instances that p is very unsure about their actual class and classified them falsely are not likely to be chosen. Note that any instance still has a base probability to be chosen.
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassifierWeightedSampling​(org.api4.java.ai.ml.classification.IClassifier pilotEstimator, java.util.Random rand, D dataset)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<ai.libs.jaicore.basic.sets.Pair<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,​java.lang.Double>> calculateAcceptanceThresholdsWithTrainedPilot​(D dataset, org.api4.java.ai.ml.classification.IClassifier pilot)  
      • 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

      • ClassifierWeightedSampling

        public ClassifierWeightedSampling​(org.api4.java.ai.ml.classification.IClassifier pilotEstimator,
                                          java.util.Random rand,
                                          D dataset)
    • Method Detail

      • calculateAcceptanceThresholdsWithTrainedPilot

        public java.util.List<ai.libs.jaicore.basic.sets.Pair<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,​java.lang.Double>> calculateAcceptanceThresholdsWithTrainedPilot​(D dataset,
                                                                                                                                                                                                  org.api4.java.ai.ml.classification.IClassifier pilot)
                                                                                                                                                                                           throws java.lang.InterruptedException
        Specified by:
        calculateAcceptanceThresholdsWithTrainedPilot in class APilotEstimateSampling<D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>>
        Throws:
        java.lang.InterruptedException