InputDataType
- The type of data used in the experiment. It is what
is passed to the fold creator to create folds from.FoldDataType
- The type of data in the folds of the experiment, as
defined by the fold creator. It is typically the same as the
InputDataType, but does not have to be.public abstract class AbstractValidationFoldExperiment<InputDataType,FoldDataType> extends AbstractLearningExperiment
AbstractValidationFoldExperiment
class implements a common way
of structuring an experiment around a ValidationFoldCreator
object
where the fold creator is used to create each of the individual trials of
the experiment.Modifier and Type | Field and Description |
---|---|
protected ValidationFoldCreator<InputDataType,FoldDataType> |
foldCreator
The method to use to create the validation folds.
|
protected int |
numTrials
The number of trials in the experiment, which is the number of folds
in the experiment.
|
listeners
Constructor and Description |
---|
AbstractValidationFoldExperiment()
Creates a new instance of AbstractValidationFoldExperiment.
|
AbstractValidationFoldExperiment(ValidationFoldCreator<InputDataType,FoldDataType> foldCreator)
Creates a new instance of AbstractValidationFoldExperiment.
|
Modifier and Type | Method and Description |
---|---|
ValidationFoldCreator<InputDataType,FoldDataType> |
getFoldCreator()
Gets the fold creator.
|
int |
getNumTrials()
Gets the number of trials in the experiment.
|
protected void |
runExperiment(java.util.Collection<PartitionedDataset<FoldDataType>> folds)
Runs the underlying validation fold experiment using the given data.
|
protected abstract void |
runTrial(PartitionedDataset<FoldDataType> fold)
Runs a single trial of the experiment on one fold of the data.
|
void |
setFoldCreator(ValidationFoldCreator<InputDataType,FoldDataType> foldCreator)
Sets the fold creator.
|
protected void |
setNumTrials(int numTrials)
Sets the number of trials in the experiment.
|
addListener, fireExperimentEnded, fireExperimentStarted, fireTrialEnded, fireTrialStarted, getListeners, removeListener, setListeners
clone
protected ValidationFoldCreator<InputDataType,FoldDataType> foldCreator
protected int numTrials
public AbstractValidationFoldExperiment()
public AbstractValidationFoldExperiment(ValidationFoldCreator<InputDataType,FoldDataType> foldCreator)
foldCreator
- The fold creator to use.protected void runExperiment(java.util.Collection<PartitionedDataset<FoldDataType>> folds)
folds
- The fold to run the experiment on.protected abstract void runTrial(PartitionedDataset<FoldDataType> fold)
fold
- The fold to run the trial of the experiment on.public ValidationFoldCreator<InputDataType,FoldDataType> getFoldCreator()
public void setFoldCreator(ValidationFoldCreator<InputDataType,FoldDataType> foldCreator)
foldCreator
- The fold creator.public int getNumTrials()
LearningExperiment
protected void setNumTrials(int numTrials)
numTrials
- The number of trials in the experiment.