Class ASampleAlgorithmFactory<D extends org.api4.java.ai.ml.core.dataset.IDataset<?>,A extends ASamplingAlgorithm<D>>
- java.lang.Object
-
- ai.libs.jaicore.ml.core.filter.sampling.inmemory.factories.ASampleAlgorithmFactory<D,A>
-
- All Implemented Interfaces:
ISamplingAlgorithmFactory<D,A>,org.api4.java.common.reconstruction.IReconstructible
- Direct Known Subclasses:
GmeansSamplingFactory,KmeansSamplingFactory,LabelBasedStratifiedSamplingFactory,LocalCaseControlSamplingFactory,OSMACSamplingFactory,SimpleRandomSamplingFactory,StratifiedSamplingFactory,SystematicSamplingFactory
public abstract class ASampleAlgorithmFactory<D extends org.api4.java.ai.ml.core.dataset.IDataset<?>,A extends ASamplingAlgorithm<D>> extends java.lang.Object implements ISamplingAlgorithmFactory<D,A>, org.api4.java.common.reconstruction.IReconstructible
-
-
Constructor Summary
Constructors Constructor Description ASampleAlgorithmFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInstruction(org.api4.java.common.reconstruction.IReconstructionInstruction instruction)static <D extends org.api4.java.ai.ml.core.dataset.IDataset<?>,A extends ASamplingAlgorithm<D>,T extends ASampleAlgorithmFactory<D,A>>
Tcreate(java.lang.Class<T> factoryClazz, int sampleSize, long seed)AgetAlgorithm(D inputDataset)After the necessary config is done, this method returns a fully configured instance of a sampling algorithm.protected ai.libs.jaicore.basic.reconstruction.ReconstructionInstructiongetConstructionInstruction()org.api4.java.common.reconstruction.IReconstructionPlangetConstructionPlan()java.util.RandomgetRandom()intgetSampleSize()longgetSeed()voidsetRandom(java.util.Random random)voidsetSampleSize(int sampleSize)voidsetSeed(long seed)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ai.libs.jaicore.ml.core.filter.sampling.inmemory.factories.interfaces.ISamplingAlgorithmFactory
getAlgorithm
-
-
-
-
Method Detail
-
create
public static <D extends org.api4.java.ai.ml.core.dataset.IDataset<?>,A extends ASamplingAlgorithm<D>,T extends ASampleAlgorithmFactory<D,A>> T create(java.lang.Class<T> factoryClazz, int sampleSize, long seed) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
- Throws:
java.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.NoSuchMethodException
-
getConstructionInstruction
protected ai.libs.jaicore.basic.reconstruction.ReconstructionInstruction getConstructionInstruction()
-
getConstructionPlan
public org.api4.java.common.reconstruction.IReconstructionPlan getConstructionPlan()
- Specified by:
getConstructionPlanin interfaceorg.api4.java.common.reconstruction.IReconstructible
-
addInstruction
public void addInstruction(org.api4.java.common.reconstruction.IReconstructionInstruction instruction)
- Specified by:
addInstructionin interfaceorg.api4.java.common.reconstruction.IReconstructible
-
getAlgorithm
public A getAlgorithm(D inputDataset)
Description copied from interface:ISamplingAlgorithmFactoryAfter the necessary config is done, this method returns a fully configured instance of a sampling algorithm. Here, it is assumed that random aspects or sample sizes have already been defined before- Specified by:
getAlgorithmin interfaceISamplingAlgorithmFactory<D extends org.api4.java.ai.ml.core.dataset.IDataset<?>,A extends ASamplingAlgorithm<D>>
-
getSampleSize
public int getSampleSize()
-
setSampleSize
public void setSampleSize(int sampleSize)
-
getRandom
public java.util.Random getRandom()
-
setRandom
public void setRandom(java.util.Random random)
-
getSeed
public long getSeed()
-
setSeed
public void setSeed(long seed)
-
-