Class OSMACSamplingFactory<I extends ILabeledAttributeArrayInstance<?>,D extends IDataset<I>>
- java.lang.Object
-
- ai.libs.jaicore.ml.core.dataset.sampling.inmemory.factories.OSMACSamplingFactory<I,D>
-
- All Implemented Interfaces:
IRerunnableSamplingAlgorithmFactory<I,D,OSMAC<I,D>>,ISamplingAlgorithmFactory<I,D,OSMAC<I,D>>
public class OSMACSamplingFactory<I extends ILabeledAttributeArrayInstance<?>,D extends IDataset<I>> extends java.lang.Object implements IRerunnableSamplingAlgorithmFactory<I,D,OSMAC<I,D>>
-
-
Constructor Summary
Constructors Constructor Description OSMACSamplingFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OSMAC<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.voidsetPreSampleSize(int preSampleSize)Set the size of the sample the pilot estimator will be trained with.voidsetPreviousRun(OSMAC<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
-
setPreSampleSize
public void setPreSampleSize(int preSampleSize)
Set the size of the sample the pilot estimator will be trained with. Default is half the dataset.- Parameters:
preSampleSize-
-
setPreviousRun
public void setPreviousRun(OSMAC<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 ILabeledAttributeArrayInstance<?>,D extends IDataset<I>,OSMAC<I extends ILabeledAttributeArrayInstance<?>,D extends IDataset<I>>>- Parameters:
previousRun- Algorithm object of the previous of the sampling algorithm.
-
getAlgorithm
public OSMAC<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 ILabeledAttributeArrayInstance<?>,D extends IDataset<I>,OSMAC<I extends ILabeledAttributeArrayInstance<?>,D extends IDataset<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.
-
-