Class SystematicSamplingFactory<I extends INumericArrayInstance,D extends IOrderedDataset<I>>
- java.lang.Object
-
- ai.libs.jaicore.ml.core.dataset.sampling.inmemory.factories.SystematicSamplingFactory<I,D>
-
- All Implemented Interfaces:
IRerunnableSamplingAlgorithmFactory<I,D,SystematicSampling<I,D>>,ISamplingAlgorithmFactory<I,D,SystematicSampling<I,D>>
public class SystematicSamplingFactory<I extends INumericArrayInstance,D extends IOrderedDataset<I>> extends java.lang.Object implements IRerunnableSamplingAlgorithmFactory<I,D,SystematicSampling<I,D>>
-
-
Constructor Summary
Constructors Constructor Description SystematicSamplingFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SystematicSampling<I,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<I> datapointComparator)Set a custom comparator that will be used to sort the datapoints before sampling.voidsetPreviousRun(SystematicSampling<I,D> previousRun)Set the previous run of the sampling algorithm, if one occurred, can be set here to get data from it.
-
-
-
Method Detail
-
setDatapointComparator
public void setDatapointComparator(java.util.Comparator<I> 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<I,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<I extends INumericArrayInstance,D extends IOrderedDataset<I>,SystematicSampling<I extends INumericArrayInstance,D extends IOrderedDataset<I>>>- Parameters:
previousRun- Algorithm object of the previous of the sampling algorithm.
-
getAlgorithm
public SystematicSampling<I,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<I extends INumericArrayInstance,D extends IOrderedDataset<I>,SystematicSampling<I extends INumericArrayInstance,D extends IOrderedDataset<I>>>- 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.
-
-