Class OSMACSamplingFactory
- java.lang.Object
-
- ai.libs.jaicore.ml.core.filter.sampling.inmemory.factories.ASampleAlgorithmFactory<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,OSMAC<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>>
-
- ai.libs.jaicore.ml.core.filter.sampling.inmemory.factories.OSMACSamplingFactory
-
- All Implemented Interfaces:
IRerunnableSamplingAlgorithmFactory<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,OSMAC<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>>,ISamplingAlgorithmFactory<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,OSMAC<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>>,org.api4.java.common.reconstruction.IReconstructible
public class OSMACSamplingFactory extends ASampleAlgorithmFactory<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,OSMAC<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>> implements IRerunnableSamplingAlgorithmFactory<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,OSMAC<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>>
-
-
Constructor Summary
Constructors Constructor Description OSMACSamplingFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OSMAC<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>getAlgorithm(int sampleSize, org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> inputDataset, java.util.Random random)After the necessary config is done, this method returns a fully configured instance of a sampling algorithm.org.api4.java.ai.ml.classification.IClassifiergetPilot()voidsetPilot(org.api4.java.ai.ml.classification.IClassifier pilot)voidsetPreSampleSize(int preSampleSize)Set the size of the sample the pilot estimator will be trained with.voidsetPreviousRun(OSMAC<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>> 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
-
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-
-
getPilot
public org.api4.java.ai.ml.classification.IClassifier getPilot()
-
setPilot
public void setPilot(org.api4.java.ai.ml.classification.IClassifier pilot)
-
setPreviousRun
public void setPreviousRun(OSMAC<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>> 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<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,OSMAC<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>>- Parameters:
previousRun- Algorithm object of the previous of the sampling algorithm.
-
getAlgorithm
public OSMAC<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>> getAlgorithm(int sampleSize, org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> 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<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,OSMAC<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.
-
-