DataType
- The type of the data to perform the experiment with.
It will be used as input into the learning algorithm.LearnedType
- The type of the output produced by the learning
algorithm whose performance will be evaluated on each data item.StatisticType
- The type of the statistic generated by the
performance evaluator on the learned object for each data item. It
is created by passing the learned object plus the data item
into the performance evaluator.SummaryType
- The type produced by the summarizer at the end of
the experiment from a collection of the given statistics (one for
each item). This represents the performance result for the learning
algorithm for the whole experiment.public class OnlineLearnerValidationExperiment<DataType,LearnedType,StatisticType,SummaryType> extends AbstractLearningExperiment implements PerformanceEvaluator<IncrementalLearner<? super DataType,LearnedType>,java.util.Collection<? extends DataType>,SummaryType>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
numTrials
The number of trials in the experiment, which is the number of folds
in the experiment.
|
protected PerformanceEvaluator<? super LearnedType,? super java.util.Collection<? extends DataType>,? extends StatisticType> |
performanceEvaluator
The evaluator to use to compute the performance of the learned object on
each fold.
|
protected java.util.ArrayList<StatisticType> |
statistics
The performance evaluations made during the experiment.
|
protected Summarizer<? super StatisticType,? extends SummaryType> |
summarizer
The summarizer for summarizing the result of the performance evaluator
from all the folds.
|
protected SummaryType |
summary
The summary of the performance evaluations made at the end of the
experiment.
|
listeners
Constructor and Description |
---|
OnlineLearnerValidationExperiment()
Creates a new instance of IncrementalLearnerValidationExperiment.
|
OnlineLearnerValidationExperiment(PerformanceEvaluator<? super LearnedType,? super java.util.Collection<? extends DataType>,? extends StatisticType> performanceEvaluator,
Summarizer<? super StatisticType,? extends SummaryType> summarizer)
Creates a new instance of IncrementalLearnerValidationExperiment.
|
Modifier and Type | Method and Description |
---|---|
SummaryType |
evaluatePerformance(IncrementalLearner<? super DataType,LearnedType> learner,
java.util.Collection<? extends DataType> data)
Performs the experiment.
|
int |
getNumTrials()
Gets the number of trials.
|
PerformanceEvaluator<? super LearnedType,? super java.util.Collection<? extends DataType>,? extends StatisticType> |
getPerformanceEvaluator()
Gets the performance evaluator to apply to each fold.
|
java.util.ArrayList<StatisticType> |
getStatistics()
Gets the performance evaluations for the trials of the experiment.
|
Summarizer<? super StatisticType,? extends SummaryType> |
getSummarizer()
Gets the summarizer of the performance evaluations.
|
SummaryType |
getSummary()
Gets the summary of the experiment.
|
protected void |
setNumTrials(int numTrials)
Sets the number of trials.
|
void |
setPerformanceEvaluator(PerformanceEvaluator<? super LearnedType,? super java.util.Collection<? extends DataType>,? extends StatisticType> performanceEvaluator)
Sets the performance evaluator to apply to each fold.
|
protected void |
setStatistics(java.util.ArrayList<StatisticType> statistics)
Sets the performance evaluations for the trials of the experiment.
|
void |
setSummarizer(Summarizer<? super StatisticType,? extends SummaryType> summarizer)
Sets the summarizer of the performance evaluations.
|
protected void |
setSummary(SummaryType summary)
Sets the summary of the experiment.
|
addListener, fireExperimentEnded, fireExperimentStarted, fireTrialEnded, fireTrialStarted, getListeners, removeListener, setListeners
clone
protected PerformanceEvaluator<? super LearnedType,? super java.util.Collection<? extends DataType>,? extends StatisticType> performanceEvaluator
protected Summarizer<? super StatisticType,? extends SummaryType> summarizer
protected int numTrials
protected java.util.ArrayList<StatisticType> statistics
protected SummaryType summary
public OnlineLearnerValidationExperiment()
public OnlineLearnerValidationExperiment(PerformanceEvaluator<? super LearnedType,? super java.util.Collection<? extends DataType>,? extends StatisticType> performanceEvaluator, Summarizer<? super StatisticType,? extends SummaryType> summarizer)
performanceEvaluator
- The evaluator to use to compute the
performance of the learned object on each fold.summarizer
- The summarizer for summarizing the result of the
performance evaluator from all the folds.public SummaryType evaluatePerformance(IncrementalLearner<? super DataType,LearnedType> learner, java.util.Collection<? extends DataType> data)
evaluatePerformance
in interface PerformanceEvaluator<IncrementalLearner<? super DataType,LearnedType>,java.util.Collection<? extends DataType>,SummaryType>
data
- The data to use.learner
- The learner to perform the experiment on.public PerformanceEvaluator<? super LearnedType,? super java.util.Collection<? extends DataType>,? extends StatisticType> getPerformanceEvaluator()
public void setPerformanceEvaluator(PerformanceEvaluator<? super LearnedType,? super java.util.Collection<? extends DataType>,? extends StatisticType> performanceEvaluator)
performanceEvaluator
- The performance evaluator to apply to each fold.public Summarizer<? super StatisticType,? extends SummaryType> getSummarizer()
public void setSummarizer(Summarizer<? super StatisticType,? extends SummaryType> summarizer)
summarizer
- The summarizer of the performance evaluations.public int getNumTrials()
getNumTrials
in interface LearningExperiment
protected void setNumTrials(int numTrials)
numTrials
- The number of trials.public java.util.ArrayList<StatisticType> getStatistics()
protected void setStatistics(java.util.ArrayList<StatisticType> statistics)
statistics
- The performance evaluations for the trials of the experiment.public SummaryType getSummary()
protected void setSummary(SummaryType summary)
summary
- The summary of the experiment.