Class LearningCurveExtrapolationEvaluator
- java.lang.Object
-
- ai.libs.jaicore.ml.core.evaluation.evaluator.LearningCurveExtrapolationEvaluator
-
- All Implemented Interfaces:
org.api4.java.ai.ml.classification.IClassifierEvaluator,org.api4.java.ai.ml.core.evaluation.ISupervisedLearnerEvaluator<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>>,org.api4.java.common.attributedobjects.IGetter<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>>,java.lang.Double>,org.api4.java.common.attributedobjects.IObjectEvaluator<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>>,java.lang.Double>,org.api4.java.common.control.ILoggingCustomizable,org.api4.java.common.event.IEventEmitter<java.lang.Object>
public class LearningCurveExtrapolationEvaluator extends java.lang.Object implements org.api4.java.ai.ml.classification.IClassifierEvaluator, org.api4.java.common.control.ILoggingCustomizable, org.api4.java.common.event.IEventEmitter<java.lang.Object>Evaluates a classifier by predicting its learning curve with a few anchorpoints. The evaluation result is the accuracy or the error rate (configurable) for the complete dataset. Depending on the chosen anchorpoints this evaluation method will be really fast, but can be inaccurate depending on the learning curve extrapolation method, since it will only give a prediction of the accuracy and does not measure it.
-
-
Constructor Summary
Constructors Constructor Description LearningCurveExtrapolationEvaluator(int[] anchorpoints, ISamplingAlgorithmFactory<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,? extends ASamplingAlgorithm<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>> samplingAlgorithmFactory, org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dataset, double trainSplitForAnchorpointsMeasurement, LearningCurveExtrapolationMethod extrapolationMethod, long seed)Create a classifier evaluator with learning curve extrapolation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Doubleevaluate(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>> classifier)Computes the (estimated) measure of the classifier on the full datasetjava.lang.StringgetLoggerName()voidregisterListener(java.lang.Object listener)Register observers for learning curve predictions (including estimates of the time)voidsetFullDatasetSize(int fullDatasetSize)voidsetLoggerName(java.lang.String name)
-
-
-
Constructor Detail
-
LearningCurveExtrapolationEvaluator
public LearningCurveExtrapolationEvaluator(int[] anchorpoints, ISamplingAlgorithmFactory<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>,? extends ASamplingAlgorithm<org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?>>> samplingAlgorithmFactory, org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dataset, double trainSplitForAnchorpointsMeasurement, LearningCurveExtrapolationMethod extrapolationMethod, long seed)Create a classifier evaluator with learning curve extrapolation.- Parameters:
anchorpoints- Anchorpoints for the learning curve extrapolation.samplingAlgorithmFactory- Subsampling factory to create a subsampler for the samples at the given anchorpoints.dataset- Dataset to evaluate the classifier with.trainSplitForAnchorpointsMeasurement- Ratio to split the subsamples at the anchorpoints into train and test.extrapolationMethod- Method to extrapolate a learning curve from the accuracy measurements at the anchorpoints.seed- Random seed.
-
-
Method Detail
-
setFullDatasetSize
public void setFullDatasetSize(int fullDatasetSize)
-
evaluate
public java.lang.Double evaluate(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>> classifier) throws java.lang.InterruptedException, org.api4.java.common.attributedobjects.ObjectEvaluationFailedExceptionComputes the (estimated) measure of the classifier on the full dataset- Specified by:
evaluatein interfaceorg.api4.java.common.attributedobjects.IObjectEvaluator<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>>,java.lang.Double>- Throws:
java.lang.InterruptedExceptionorg.api4.java.common.attributedobjects.ObjectEvaluationFailedException
-
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
-
registerListener
public void registerListener(java.lang.Object listener)
Register observers for learning curve predictions (including estimates of the time)- Specified by:
registerListenerin interfaceorg.api4.java.common.event.IEventEmitter<java.lang.Object>- Parameters:
listener-
-
-