Class LearningCurveExtrapolator
- java.lang.Object
-
- ai.libs.jaicore.ml.functionprediction.learner.learningcurveextrapolation.LearningCurveExtrapolator
-
- All Implemented Interfaces:
org.api4.java.common.control.ILoggingCustomizable
- Direct Known Subclasses:
ConfigurationLearningCurveExtrapolator
public class LearningCurveExtrapolator extends java.lang.Object implements org.api4.java.common.control.ILoggingCustomizableAbstract class for implementing a learning curve extrapolation method with some anchor points. For each of this anchorpoints a subsample will be drawn and a classifier will be trained with this sample. Based on the points (subsample size, learner accuracy) a custom method of learning curve extrapolation can be applied.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>datasetprotected LearningCurveExtrapolationMethodextrapolationMethodprotected org.api4.java.ai.ml.core.learner.ISupervisedLearner<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>>learnerprotected java.util.Randomrandomprotected ASamplingAlgorithm<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>>samplingAlgorithmprotected ISamplingAlgorithmFactory<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,? extends ASamplingAlgorithm<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>>samplingAlgorithmFactoryprotected org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>testprotected org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>train
-
Constructor Summary
Constructors Constructor Description LearningCurveExtrapolator(LearningCurveExtrapolationMethod extrapolationMethod, org.api4.java.ai.ml.core.learner.ISupervisedLearner<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>> learner, org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dataset, double trainsplit, int[] anchorPoints, ISamplingAlgorithmFactory<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,? extends ASamplingAlgorithm<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>> samplingAlgorithmFactory, long seed)Create a learning curve extrapolator with a subsampling factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.api4.java.ai.ml.core.evaluation.learningcurve.ILearningCurveextrapolateLearningCurve()Measure the learner accuracy at the given anchorpoints and extrapolate a learning curve based the results.int[]getAnchorPoints()org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>getDataset()LearningCurveExtrapolationMethodgetExtrapolationMethod()org.api4.java.ai.ml.core.learner.ISupervisedLearner<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>>getLearner()java.lang.StringgetLoggerName()int[]getTrainingTimes()double[]getyValues()voidsetLoggerName(java.lang.String name)
-
-
-
Field Detail
-
learner
protected org.api4.java.ai.ml.core.learner.ISupervisedLearner<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>> learner
-
dataset
protected org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance> dataset
-
train
protected org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance> train
-
test
protected org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance> test
-
samplingAlgorithmFactory
protected ISamplingAlgorithmFactory<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,? extends ASamplingAlgorithm<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>> samplingAlgorithmFactory
-
samplingAlgorithm
protected ASamplingAlgorithm<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>> samplingAlgorithm
-
random
protected java.util.Random random
-
extrapolationMethod
protected LearningCurveExtrapolationMethod extrapolationMethod
-
-
Constructor Detail
-
LearningCurveExtrapolator
public LearningCurveExtrapolator(LearningCurveExtrapolationMethod extrapolationMethod, org.api4.java.ai.ml.core.learner.ISupervisedLearner<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>> learner, org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dataset, double trainsplit, int[] anchorPoints, ISamplingAlgorithmFactory<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,? extends ASamplingAlgorithm<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>> samplingAlgorithmFactory, long seed) throws org.api4.java.ai.ml.core.exception.DatasetCreationException, java.lang.InterruptedException
Create a learning curve extrapolator with a subsampling factory.- Parameters:
extrapolationMethod- Method for extrapolating a learning curve from anchorpoints.learner- Learning model to predict the learning curve of.dataset- Dataset to measure evaluate the learner on.trainsplit- Portion of the dataset, which shall be used to sample from for training.samplingAlgorithmFactory- Subsampling algorithm factory to create a configured subsampler with.seed- Random seed.- Throws:
org.api4.java.ai.ml.core.exception.DatasetCreationExceptionjava.lang.InterruptedException
-
-
Method Detail
-
extrapolateLearningCurve
public org.api4.java.ai.ml.core.evaluation.learningcurve.ILearningCurve extrapolateLearningCurve() throws InvalidAnchorPointsException, org.api4.java.algorithm.exceptions.AlgorithmException, java.lang.InterruptedExceptionMeasure the learner accuracy at the given anchorpoints and extrapolate a learning curve based the results.- Parameters:
anchorPoints- Sample sizes as anchorpoints, where the true accuracy shall be measured.- Returns:
- The extrapolated learning curve.
- Throws:
InvalidAnchorPointsException- The anchorpoints (amount, values, ...) are not suitable for the given learning curve extrapolation method.org.api4.java.algorithm.exceptions.AlgorithmException- An error occured during the creation of the specified anchorpoints.java.lang.InterruptedException
-
getLearner
public org.api4.java.ai.ml.core.learner.ISupervisedLearner<org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance,org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<? extends org.api4.java.ai.ml.core.dataset.supervised.ILabeledInstance>> getLearner()
-
getDataset
public org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> getDataset()
-
getExtrapolationMethod
public LearningCurveExtrapolationMethod getExtrapolationMethod()
-
getAnchorPoints
public int[] getAnchorPoints()
-
getyValues
public double[] getyValues()
-
getTrainingTimes
public int[] getTrainingTimes()
-
getLoggerName
public java.lang.String getLoggerName()
- Specified by:
getLoggerNamein interfaceorg.api4.java.common.control.ILoggingCustomizable
-
setLoggerName
public void setLoggerName(java.lang.String name)
- Specified by:
setLoggerNamein interfaceorg.api4.java.common.control.ILoggingCustomizable
-
-