Class LearningCurveExtrapolator<I extends ILabeledAttributeArrayInstance<?>,D extends IOrderedLabeledAttributeArrayDataset<I,?>>
- java.lang.Object
-
- ai.libs.jaicore.ml.learningcurve.extrapolation.LearningCurveExtrapolator<I,D>
-
- All Implemented Interfaces:
ai.libs.jaicore.basic.ILoggingCustomizable
- Direct Known Subclasses:
ConfigurationLearningCurveExtrapolator
public class LearningCurveExtrapolator<I extends ILabeledAttributeArrayInstance<?>,D extends IOrderedLabeledAttributeArrayDataset<I,?>> extends java.lang.Object implements ai.libs.jaicore.basic.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 Ddatasetprotected LearningCurveExtrapolationMethodextrapolationMethodprotected weka.classifiers.Classifierlearnerprotected java.util.Randomrandomprotected ASamplingAlgorithm<I,D>samplingAlgorithmprotected ISamplingAlgorithmFactory<I,D,? extends ASamplingAlgorithm<I,D>>samplingAlgorithmFactoryprotected Dtestprotected Dtrain
-
Constructor Summary
Constructors Constructor Description LearningCurveExtrapolator(LearningCurveExtrapolationMethod extrapolationMethod, weka.classifiers.Classifier learner, D dataset, double trainsplit, int[] anchorPoints, ISamplingAlgorithmFactory<I,D,? extends ASamplingAlgorithm<I,D>> 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 LearningCurveextrapolateLearningCurve()Measure the learner accuracy at the given anchorpoints and extrapolate a learning curve based the results.int[]getAnchorPoints()DgetDataset()LearningCurveExtrapolationMethodgetExtrapolationMethod()weka.classifiers.ClassifiergetLearner()java.lang.StringgetLoggerName()int[]getTrainingTimes()double[]getyValues()voidsetLoggerName(java.lang.String name)
-
-
-
Field Detail
-
learner
protected weka.classifiers.Classifier learner
-
dataset
protected D extends IOrderedLabeledAttributeArrayDataset<I,?> dataset
-
train
protected D extends IOrderedLabeledAttributeArrayDataset<I,?> train
-
test
protected D extends IOrderedLabeledAttributeArrayDataset<I,?> test
-
samplingAlgorithmFactory
protected ISamplingAlgorithmFactory<I extends ILabeledAttributeArrayInstance<?>,D extends IOrderedLabeledAttributeArrayDataset<I,?>,? extends ASamplingAlgorithm<I extends ILabeledAttributeArrayInstance<?>,D extends IOrderedLabeledAttributeArrayDataset<I,?>>> samplingAlgorithmFactory
-
samplingAlgorithm
protected ASamplingAlgorithm<I extends ILabeledAttributeArrayInstance<?>,D extends IOrderedLabeledAttributeArrayDataset<I,?>> samplingAlgorithm
-
random
protected java.util.Random random
-
extrapolationMethod
protected LearningCurveExtrapolationMethod extrapolationMethod
-
-
Constructor Detail
-
LearningCurveExtrapolator
public LearningCurveExtrapolator(LearningCurveExtrapolationMethod extrapolationMethod, weka.classifiers.Classifier learner, D dataset, double trainsplit, int[] anchorPoints, ISamplingAlgorithmFactory<I,D,? extends ASamplingAlgorithm<I,D>> samplingAlgorithmFactory, long seed) throws DatasetCreationException
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:
DatasetCreationException
-
-
Method Detail
-
extrapolateLearningCurve
public LearningCurve extrapolateLearningCurve() throws InvalidAnchorPointsException, ai.libs.jaicore.basic.algorithm.exceptions.AlgorithmException, java.lang.InterruptedException
Measure 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.ai.libs.jaicore.basic.algorithm.exceptions.AlgorithmException- An error occured during the creation of the specified anchorpoints.java.lang.InterruptedException
-
getLearner
public weka.classifiers.Classifier getLearner()
-
getDataset
public D 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 interfaceai.libs.jaicore.basic.ILoggingCustomizable
-
setLoggerName
public void setLoggerName(java.lang.String name)
- Specified by:
setLoggerNamein interfaceai.libs.jaicore.basic.ILoggingCustomizable
-
-