Package weka.classifiers
Interface CrossValidationFoldGenerator
-
- All Superinterfaces:
CrossValidationFoldGenerator<weka.core.Instances,WekaTrainTestSetContainer>,Destroyable,InstancesViewSupporter,Iterator<WekaTrainTestSetContainer>,OptionHandler,Randomizable,Serializable,SplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>,SplitGenerator,StratifiableSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- All Known Implementing Classes:
BinnedNumericClassCrossValidationFoldGenerator,DefaultCrossValidationFoldGenerator,GroupedBinnedNumericClassCrossValidationFoldGenerator,GroupedCrossValidationFoldGenerator,GroupedCrossValidationFoldGeneratorUsingNumericClassValues
public interface CrossValidationFoldGenerator extends SplitGenerator, CrossValidationFoldGenerator<weka.core.Instances,WekaTrainTestSetContainer>, 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.intgetActualNumFolds()Returns the actual number of folds used (eg when using LOO).intgetNumFolds()Returns the number of folds.booleangetRandomize()Returns whether to randomize the data.StringgetRelationName()Returns the relation name template.booleangetStratify()Returns whether to stratify the data (in case of nominal class).voidsetNumFolds(int value)Sets the number of folds to use.voidsetRandomize(boolean value)Sets whether to randomize the data.voidsetRelationName(String value)Sets the template for the relation name.voidsetStratify(boolean value)Sets whether to stratify the data (nominal class).-
Methods inherited from interface adams.core.Destroyable
destroy
-
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 adams.core.Randomizable
getSeed, seedTipText, setSeed
-
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:
setNumFoldsin interfaceCrossValidationFoldGenerator<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:
getNumFoldsin interfaceCrossValidationFoldGenerator<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:
getActualNumFoldsin interfaceCrossValidationFoldGenerator<weka.core.Instances,WekaTrainTestSetContainer>- Returns:
- the actual number of folds
-
setRandomize
void setRandomize(boolean value)
Sets whether to randomize the data.- Specified by:
setRandomizein interfaceCrossValidationFoldGenerator<weka.core.Instances,WekaTrainTestSetContainer>- Parameters:
value- true if to randomize the data
-
getRandomize
boolean getRandomize()
Returns whether to randomize the data.- Specified by:
getRandomizein interfaceCrossValidationFoldGenerator<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:
setStratifyin interfaceStratifiableSplitGenerator<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:
getStratifyin interfaceStratifiableSplitGenerator<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:
crossValidationIndicesin interfaceCrossValidationFoldGenerator<weka.core.Instances,WekaTrainTestSetContainer>- Returns:
- the indices
-
-