public class SystematicSamplingFactory<I extends INumericArrayInstance,D extends IOrderedDataset<I>> extends java.lang.Object implements IRerunnableSamplingAlgorithmFactory<D,SystematicSampling<I,D>>
| Constructor and Description |
|---|
SystematicSamplingFactory() |
| Modifier and Type | Method and 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.
|
void |
setDatapointComparator(java.util.Comparator<I> datapointComparator)
Set a custom comparator that will be used to sort the datapoints before
sampling.
|
void |
setPreviousRun(SystematicSampling<I,D> previousRun)
Set the previous run of the sampling algorithm, if one occurred, can be set
here to get data from it.
|
public void setDatapointComparator(java.util.Comparator<I> datapointComparator)
datapointComparator - Comparator for two datapoints.public void setPreviousRun(SystematicSampling<I,D> previousRun)
IRerunnableSamplingAlgorithmFactorysetPreviousRun in interface IRerunnableSamplingAlgorithmFactory<D extends IOrderedDataset<I>,SystematicSampling<I extends INumericArrayInstance,D extends IOrderedDataset<I>>>previousRun - Algorithm object of the previous of the sampling
algorithm.public SystematicSampling<I,D> getAlgorithm(int sampleSize, D inputDataset, java.util.Random random)
ISamplingAlgorithmFactorygetAlgorithm in interface ISamplingAlgorithmFactory<D extends IOrderedDataset<I>,SystematicSampling<I extends INumericArrayInstance,D extends IOrderedDataset<I>>>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.