Package weka.classifiers
Interface CrossValidationFoldGenerator
-
- All Superinterfaces:
adams.data.splitgenerator.CrossValidationFoldGenerator<weka.core.Instances,WekaTrainTestSetContainer>
,adams.core.Destroyable
,InstancesViewSupporter
,Iterator<WekaTrainTestSetContainer>
,adams.core.option.OptionHandler
,adams.core.Randomizable
,Serializable
,adams.data.splitgenerator.SplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>
,SplitGenerator
,adams.data.splitgenerator.StratifiableSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- All Known Implementing Classes:
BinnedNumericClassCrossValidationFoldGenerator
,DefaultCrossValidationFoldGenerator
,GroupedBinnedNumericClassCrossValidationFoldGenerator
,GroupedCrossValidationFoldGenerator
,GroupedCrossValidationFoldGeneratorUsingNumericClassValues
public interface CrossValidationFoldGenerator extends SplitGenerator, adams.data.splitgenerator.CrossValidationFoldGenerator<weka.core.Instances,WekaTrainTestSetContainer>, adams.data.splitgenerator.StratifiableSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>
Interface for generating cross-validation folds.
The template for the relation name accepts the following placeholders:- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int[]
crossValidationIndices()
Returns the cross-validation indices.int
getActualNumFolds()
Returns the actual number of folds used (eg when using LOO).int
getNumFolds()
Returns the number of folds.boolean
getRandomize()
Returns whether to randomize the data.String
getRelationName()
Returns the relation name template.boolean
getStratify()
Returns whether to stratify the data (in case of nominal class).void
setNumFolds(int value)
Sets the number of folds to use.void
setRandomize(boolean value)
Sets whether to randomize the data.void
setRelationName(String value)
Sets the template for the relation name.void
setStratify(boolean value)
Sets whether to stratify the data (nominal class).-
Methods inherited from interface adams.data.weka.InstancesViewSupporter
getUseViews, setUseViews
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, defineOptions, getOptionManager, toCommandLine
-
Methods inherited from interface weka.classifiers.SplitGenerator
getData, hasNext, initializeIterator, next, remove, setData, toString
-
-
-
-
Method Detail
-
setNumFolds
void setNumFolds(int value)
Sets the number of folds to use.- Specified by:
setNumFolds
in interfaceadams.data.splitgenerator.CrossValidationFoldGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- Parameters:
value
- the number of folds, less than 2 for LOO
-
getNumFolds
int getNumFolds()
Returns the number of folds.- Specified by:
getNumFolds
in interfaceadams.data.splitgenerator.CrossValidationFoldGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- Returns:
- the number of folds
-
getActualNumFolds
int getActualNumFolds()
Returns the actual number of folds used (eg when using LOO).- Specified by:
getActualNumFolds
in interfaceadams.data.splitgenerator.CrossValidationFoldGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- Returns:
- the actual number of folds
-
setRandomize
void setRandomize(boolean value)
Sets whether to randomize the data.- Specified by:
setRandomize
in interfaceadams.data.splitgenerator.CrossValidationFoldGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- Parameters:
value
- true if to randomize the data
-
getRandomize
boolean getRandomize()
Returns whether to randomize the data.- Specified by:
getRandomize
in interfaceadams.data.splitgenerator.CrossValidationFoldGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- Returns:
- true if to randomize the data
-
setStratify
void setStratify(boolean value)
Sets whether to stratify the data (nominal class).- Specified by:
setStratify
in interfaceadams.data.splitgenerator.StratifiableSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- Parameters:
value
- whether to stratify the data (nominal class)
-
getStratify
boolean getStratify()
Returns whether to stratify the data (in case of nominal class).- Specified by:
getStratify
in interfaceadams.data.splitgenerator.StratifiableSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- Returns:
- true if to stratify
-
setRelationName
void setRelationName(String value)
Sets the template for the relation name.- Parameters:
value
- the template
-
getRelationName
String getRelationName()
Returns the relation name template.- Returns:
- the template
-
crossValidationIndices
int[] crossValidationIndices()
Returns the cross-validation indices.- Specified by:
crossValidationIndices
in interfaceadams.data.splitgenerator.CrossValidationFoldGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- Returns:
- the indices
-
-