ai.libs.jaicore.ml.core.dataset.sampling.inmemory

Class KmeansSampling<I extends IInstance>

  • All Implemented Interfaces:
    ai.libs.jaicore.basic.algorithm.IAlgorithm<IDataset<I>,IDataset<I>>, ai.libs.jaicore.basic.Cancelable, ai.libs.jaicore.basic.ILoggingCustomizable, java.lang.Iterable<ai.libs.jaicore.basic.algorithm.events.AlgorithmEvent>, java.util.concurrent.Callable<IDataset<I>>, java.util.Iterator<ai.libs.jaicore.basic.algorithm.events.AlgorithmEvent>


    public class KmeansSampling<I extends IInstance>extends ClusterSampling<I>
    Implementation of a sampling method using kmeans-clustering. This algorithm produces clusters of the given points and checks weather all points in a cluster have the same target Attribute. If yes only the point nearest to the center is added, otherwise the whole cluster is added to the sample.

    Caution: This does ignore the given sample size!

    • Constructor Summary

      Constructors 
      Constructor and Description
      KmeansSampling(long seed, org.apache.commons.math3.ml.distance.DistanceMeasure dist, IDataset<I> input)
      Implementation of a sampling method using kmeans-clustering.
      KmeansSampling(long seed, int k, org.apache.commons.math3.ml.distance.DistanceMeasure dist, IDataset<I> input)
      Implementation of a sampling method using kmeans-clustering.
      KmeansSampling(long seed, int k, IDataset<I> input)
      Implementation of a sampling method using kmeans-clustering.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      ai.libs.jaicore.basic.algorithm.events.AlgorithmEventnextWithException() 
      • 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, 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 java.lang.Iterable

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

        forEachRemaining, remove
    • Constructor Detail

      • KmeansSampling

        public KmeansSampling(long seed,                      int k,                      IDataset<I> input)
        Implementation of a sampling method using kmeans-clustering.
        Parameters:
        seed - RAndom Seed
        k - number of clusters
      • KmeansSampling

        public KmeansSampling(long seed,                      org.apache.commons.math3.ml.distance.DistanceMeasure dist,                      IDataset<I> input)
        Implementation of a sampling method using kmeans-clustering. The sample size will be used as the number of clusters.
        Parameters:
        seed - Random Seed
        dist - DistanceMeasure to be used
      • KmeansSampling

        public KmeansSampling(long seed,                      int k,                      org.apache.commons.math3.ml.distance.DistanceMeasure dist,                      IDataset<I> input)
        Implementation of a sampling method using kmeans-clustering.
        Parameters:
        seed - Random Seed
        k - number of clusters
        dist - DistanceMeasure to be used
    • Method Detail

      • nextWithException

        public ai.libs.jaicore.basic.algorithm.events.AlgorithmEvent nextWithException()                                                                        throws ai.libs.jaicore.basic.algorithm.exceptions.AlgorithmException
        Throws:
        ai.libs.jaicore.basic.algorithm.exceptions.AlgorithmException


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14