Class StratifiedSamplingFactory<I,D extends IOrderedDataset<I>>
- java.lang.Object
-
- ai.libs.jaicore.ml.core.dataset.sampling.inmemory.factories.StratifiedSamplingFactory<I,D>
-
- All Implemented Interfaces:
IRerunnableSamplingAlgorithmFactory<I,D,StratifiedSampling<I,D>>,ISamplingAlgorithmFactory<I,D,StratifiedSampling<I,D>>
public class StratifiedSamplingFactory<I,D extends IOrderedDataset<I>> extends java.lang.Object implements IRerunnableSamplingAlgorithmFactory<I,D,StratifiedSampling<I,D>>
-
-
Constructor Summary
Constructors Constructor Description StratifiedSamplingFactory(IStratiAmountSelector<D> stratiAmountSelector, IStratiAssigner<I,D> stratiAssigner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StratifiedSampling<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.voidsetPreviousRun(StratifiedSampling<I,D> previousRun)Set the previous run of the sampling algorithm, if one occurred, can be set here to get data from it.
-
-
-
Constructor Detail
-
StratifiedSamplingFactory
public StratifiedSamplingFactory(IStratiAmountSelector<D> stratiAmountSelector, IStratiAssigner<I,D> stratiAssigner)
-
-
Method Detail
-
setPreviousRun
public void setPreviousRun(StratifiedSampling<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,D extends IOrderedDataset<I>,StratifiedSampling<I,D extends IOrderedDataset<I>>>- Parameters:
previousRun- Algorithm object of the previous of the sampling algorithm.
-
getAlgorithm
public StratifiedSampling<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,D extends IOrderedDataset<I>,StratifiedSampling<I,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.
-
-