Class InstancesCrossValidationFoldGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.indexedsplitsrunsgenerator.AbstractIndexedSplitsRunsGenerator
-
- adams.flow.transformer.indexedsplitsrunsgenerator.AbstractInstancesIndexedSplitsRunsGenerator
-
- adams.flow.transformer.indexedsplitsrunsgenerator.InstancesCrossValidationFoldGenerator
-
- All Implemented Interfaces:
adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.OptionalRandomizable,adams.core.QuickInfoSupporter,adams.core.Randomizable,adams.core.SizeOfHandler,adams.flow.core.FlowContextHandler,adams.flow.transformer.indexedsplitsrunsgenerator.IndexedSplitsRunsGenerator,InstancesIndexedSplitsRunsGenerator,Serializable
public class InstancesCrossValidationFoldGenerator extends AbstractInstancesIndexedSplitsRunsGenerator implements adams.core.OptionalRandomizable
Split generator that generates folds for cross-validation for Instances objects.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_NumFoldsthe number of folds.protected booleanm_Randomizewhether to randomize the data.protected longm_Seedthe seed value.protected booleanm_Stratifywhether to stratify the data (in case of nominal class).-
Fields inherited from class adams.flow.transformer.indexedsplitsrunsgenerator.AbstractInstancesIndexedSplitsRunsGenerator
m_AddAttributeInformation, m_AddDatasetInformation
-
Fields inherited from class adams.flow.transformer.indexedsplitsrunsgenerator.AbstractIndexedSplitsRunsGenerator
m_FlowContext, m_MetaData
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.flow.transformer.indexedsplitsrunsgenerator.InstancesIndexedSplitsRunsGenerator
DATASET_NAME, DATASET_NUMATTRIBUTES, DATASET_NUMINSTANCES, PREFIX_DATASET_ATTRIBUTE, SUFFIX_NAME, SUFFIX_TYPE
-
-
Constructor Summary
Constructors Constructor Description InstancesCrossValidationFoldGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Stringcheck(Object data)Checks whether the data can be processed.voiddefineOptions()Adds options to the internal list of options.protected adams.data.indexedsplits.IndexedSplitsRunsdoGenerate(Object data, adams.core.MessageCollection errors)Generates the indexed splits.intgetNumFolds()Returns the number of folds.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.booleangetRandomize()Returns whether to randomize the data.longgetSeed()Returns the seed value.booleangetStratify()Returns whether to stratify the data (in case of nominal class).StringglobalInfo()Returns a string describing the object.StringnumFoldsTipText()Returns the tip text for this property.StringrandomizeTipText()Returns the tip text for this property.StringseedTipText()Returns the tip text for this property.voidsetNumFolds(int value)Sets the number of folds to use.voidsetRandomize(boolean value)Sets whether to randomize the data.voidsetSeed(long value)Sets the seed value.voidsetStratify(boolean value)Sets whether to stratify the data (nominal class).StringstratifyTipText()Returns the tip text for this property.-
Methods inherited from class adams.flow.transformer.indexedsplitsrunsgenerator.AbstractInstancesIndexedSplitsRunsGenerator
accepts, addAttributeInformationTipText, addDatasetInformationTipText, getAddAttributeInformation, getAddDatasetInformation, postGenerate, setAddAttributeInformation, setAddDatasetInformation
-
Methods inherited from class adams.flow.transformer.indexedsplitsrunsgenerator.AbstractIndexedSplitsRunsGenerator
generate, getFlowContext, getMetaData, metaDataTipText, setFlowContext, setMetaData
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classAbstractInstancesIndexedSplitsRunsGenerator
-
setNumFolds
public void setNumFolds(int value)
Sets the number of folds to use.- Parameters:
value- the number of folds, less than 2 for LOO
-
getNumFolds
public int getNumFolds()
Returns the number of folds.- Returns:
- the number of folds
-
numFoldsTipText
public String numFoldsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRandomize
public void setRandomize(boolean value)
Sets whether to randomize the data.- Specified by:
setRandomizein interfaceadams.core.OptionalRandomizable- Parameters:
value- true if to randomize the data
-
getRandomize
public boolean getRandomize()
Returns whether to randomize the data.- Specified by:
getRandomizein interfaceadams.core.OptionalRandomizable- Returns:
- true if to randomize the data
-
randomizeTipText
public String randomizeTipText()
Returns the tip text for this property.- Specified by:
randomizeTipTextin interfaceadams.core.OptionalRandomizable- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSeed
public void setSeed(long value)
Sets the seed value.- Specified by:
setSeedin interfaceadams.core.Randomizable- Parameters:
value- the seed
-
getSeed
public long getSeed()
Returns the seed value.- Specified by:
getSeedin interfaceadams.core.Randomizable- Returns:
- the seed
-
seedTipText
public String seedTipText()
Returns the tip text for this property.- Specified by:
seedTipTextin interfaceadams.core.Randomizable- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setStratify
public void setStratify(boolean value)
Sets whether to stratify the data (nominal class).- Parameters:
value- whether to stratify the data (nominal class)
-
getStratify
public boolean getStratify()
Returns whether to stratify the data (in case of nominal class).- Returns:
- true if to stratify
-
stratifyTipText
public String stratifyTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Overrides:
getQuickInfoin classAbstractInstancesIndexedSplitsRunsGenerator- Returns:
- null if no info available, otherwise short string
-
check
protected String check(Object data)
Checks whether the data can be processed.- Overrides:
checkin classadams.flow.transformer.indexedsplitsrunsgenerator.AbstractIndexedSplitsRunsGenerator- Parameters:
data- the data to check- Returns:
- null if checks passed, otherwise error message
-
doGenerate
protected adams.data.indexedsplits.IndexedSplitsRuns doGenerate(Object data, adams.core.MessageCollection errors)
Generates the indexed splits.- Specified by:
doGeneratein classadams.flow.transformer.indexedsplitsrunsgenerator.AbstractIndexedSplitsRunsGenerator- Parameters:
data- the data to use for generating the splitserrors- for storing any errors occurring during processing- Returns:
- the splits or null in case of error
-
-