Class GroupedCrossValidation
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.preparefilebaseddataset.AbstractFileBasedDatasetPreparation<T>
-
- adams.flow.transformer.preparefilebaseddataset.AbstractRandomizableFileBasedDatasetPreparation<String[]>
-
- adams.flow.transformer.preparefilebaseddataset.CrossValidation
-
- adams.flow.transformer.preparefilebaseddataset.GroupedCrossValidation
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,Randomizable
,SizeOfHandler
,Serializable
public class GroupedCrossValidation extends CrossValidation
Generates grouped cross-validation folds.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_Group
the group expression.protected BaseRegExp
m_RegExp
the regular expression for the nominal/string attribute.protected boolean
m_RemoveExtension
whether to remove the extension.protected boolean
m_UseOnlyName
whether to only use the name, not the path inthe grouping.-
Fields inherited from class adams.flow.transformer.preparefilebaseddataset.CrossValidation
m_ActualNumFolds, m_NumFolds, m_Randomize
-
Fields inherited from class adams.flow.transformer.preparefilebaseddataset.AbstractRandomizableFileBasedDatasetPreparation
m_Seed
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description GroupedCrossValidation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class
accepts()
Returns the class that the preparation scheme accepts as input.protected String
check(String[] data)
Hook method for checking the data.void
defineOptions()
Adds options to the internal list of options.protected List<FileBasedDatasetContainer>
doPrepare(String[] data)
Prepares the data.String
getGroup()
Returns the replacement string to use as group (eg '$2').String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.BaseRegExp
getRegExp()
Returns the regular expression for identifying the group (eg '^(.*)-([0-9]+)-(.*)$').boolean
getRemoveExtension()
Returns whether to remove the extension from the filename before applying the regular expression.boolean
getUseOnlyName()
Returns whether to use only the file name, not the path, in the grouping..String
globalInfo()
Returns a string describing the object.String
groupTipText()
Returns the tip text for this property.String
regExpTipText()
Returns the tip text for this property.String
removeExtensionTipText()
Returns the tip text for this property.void
setGroup(String value)
Sets the replacement string to use as group (eg '$2').void
setRegExp(BaseRegExp value)
Sets the regular expression for identifying the group (eg '^(.*)-([0-9]+)-(.*)$').void
setRemoveExtension(boolean value)
Sets whether to remove the extension from the filename before applying the regular expression.void
setUseOnlyName(boolean value)
Sets whether to use only the file name, not the path, in the grouping.String
useOnlyNameTipText()
Returns the tip text for this property.-
Methods inherited from class adams.flow.transformer.preparefilebaseddataset.CrossValidation
getActualNumFolds, getNumFolds, getRandomize, numFoldsTipText, randomizeTipText, reset, setNumFolds, setRandomize
-
Methods inherited from class adams.flow.transformer.preparefilebaseddataset.AbstractRandomizableFileBasedDatasetPreparation
getSeed, seedTipText, setSeed
-
Methods inherited from class adams.flow.transformer.preparefilebaseddataset.AbstractFileBasedDatasetPreparation
prepare
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, 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
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_RegExp
protected BaseRegExp m_RegExp
the regular expression for the nominal/string attribute.
-
m_Group
protected String m_Group
the group expression.
-
m_UseOnlyName
protected boolean m_UseOnlyName
whether to only use the name, not the path inthe grouping.
-
m_RemoveExtension
protected boolean m_RemoveExtension
whether to remove the extension.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Overrides:
globalInfo
in classCrossValidation
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classCrossValidation
-
setRegExp
public void setRegExp(BaseRegExp value)
Sets the regular expression for identifying the group (eg '^(.*)-([0-9]+)-(.*)$').- Parameters:
value
- the expression
-
getRegExp
public BaseRegExp getRegExp()
Returns the regular expression for identifying the group (eg '^(.*)-([0-9]+)-(.*)$').- Returns:
- the expression
-
regExpTipText
public String regExpTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setGroup
public void setGroup(String value)
Sets the replacement string to use as group (eg '$2').- Parameters:
value
- the group
-
getGroup
public String getGroup()
Returns the replacement string to use as group (eg '$2').- Returns:
- the group
-
groupTipText
public String groupTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUseOnlyName
public void setUseOnlyName(boolean value)
Sets whether to use only the file name, not the path, in the grouping.- Parameters:
value
- true if to use only the name
-
getUseOnlyName
public boolean getUseOnlyName()
Returns whether to use only the file name, not the path, in the grouping..- Returns:
- true if to use only the name
-
useOnlyNameTipText
public String useOnlyNameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRemoveExtension
public void setRemoveExtension(boolean value)
Sets whether to remove the extension from the filename before applying the regular expression.- Parameters:
value
- true if to remove the extension
-
getRemoveExtension
public boolean getRemoveExtension()
Returns whether to remove the extension from the filename before applying the regular expression.- Returns:
- true if to remove the extension
-
removeExtensionTipText
public String removeExtensionTipText()
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:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classCrossValidation
- Returns:
- null if no info available, otherwise short string
-
accepts
public Class accepts()
Returns the class that the preparation scheme accepts as input.- Overrides:
accepts
in classCrossValidation
- Returns:
- the class
-
check
protected String check(String[] data)
Hook method for checking the data.- Overrides:
check
in classCrossValidation
- Parameters:
data
- the data to check- Returns:
- null if succesful, otherwise error message
-
doPrepare
protected List<FileBasedDatasetContainer> doPrepare(String[] data)
Prepares the data.- Overrides:
doPrepare
in classCrossValidation
- Parameters:
data
- the data to use- Returns:
- the generated container
-
-