Class SystematicSamplingFactory<D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>
- java.lang.Object
-
- ai.libs.jaicore.ml.core.filter.sampling.inmemory.factories.ASampleAlgorithmFactory<D,SystematicSampling<D>>
-
- ai.libs.jaicore.ml.core.filter.sampling.inmemory.factories.SystematicSamplingFactory<D>
-
- All Implemented Interfaces:
IRerunnableSamplingAlgorithmFactory<D,SystematicSampling<D>>,ISamplingAlgorithmFactory<D,SystematicSampling<D>>,org.api4.java.common.reconstruction.IReconstructible
public class SystematicSamplingFactory<D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>> extends ASampleAlgorithmFactory<D,SystematicSampling<D>> implements IRerunnableSamplingAlgorithmFactory<D,SystematicSampling<D>>
-
-
Constructor Summary
Constructors Constructor Description SystematicSamplingFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SystematicSampling<D>getAlgorithm(int sampleSize, D inputDataset, java.util.Random random)After the necessary config is done, this method returns a fully configured instance of a sampling algorithm.voidsetDatapointComparator(java.util.Comparator<org.api4.java.ai.ml.core.dataset.IInstance> datapointComparator)Set a custom comparator that will be used to sort the datapoints before sampling.voidsetPreviousRun(SystematicSampling<D> previousRun)Set the previous run of the sampling algorithm, if one occurred, can be set here to get data from it.-
Methods inherited from class ai.libs.jaicore.ml.core.filter.sampling.inmemory.factories.ASampleAlgorithmFactory
addInstruction, create, getAlgorithm, getConstructionInstruction, getConstructionPlan, getRandom, getSampleSize, getSeed, setRandom, setSampleSize, setSeed
-
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
-
setDatapointComparator
public void setDatapointComparator(java.util.Comparator<org.api4.java.ai.ml.core.dataset.IInstance> datapointComparator)
Set a custom comparator that will be used to sort the datapoints before sampling.- Parameters:
datapointComparator- Comparator for two datapoints.
-
setPreviousRun
public void setPreviousRun(SystematicSampling<D> previousRun)
Description copied from interface:IRerunnableSamplingAlgorithmFactorySet the previous run of the sampling algorithm, if one occurred, can be set here to get data from it.- Specified by:
setPreviousRunin interfaceIRerunnableSamplingAlgorithmFactory<D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,SystematicSampling<D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>>- Parameters:
previousRun- Algorithm object of the previous of the sampling algorithm.
-
getAlgorithm
public SystematicSampling<D> getAlgorithm(int sampleSize, D inputDataset, java.util.Random random)
Description copied from interface:ISamplingAlgorithmFactoryAfter the necessary config is done, this method returns a fully configured instance of a sampling algorithm.- Specified by:
getAlgorithmin interfaceISamplingAlgorithmFactory<D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,SystematicSampling<D extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>>- Parameters:
sampleSize- Desired size of the sample that will be created.inputDataset- Dataset where the sample will be drawn from.random- Random object to make samples reproducible.- Returns:
- Configured sampling algorithm object.
-
-