Class TrainValidateTestSplit
- 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.TrainValidateTestSplit
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,Randomizable,SizeOfHandler,Serializable
- Direct Known Subclasses:
GroupedTrainValidateTestSplit
public class TrainValidateTestSplit extends AbstractRandomizableFileBasedDatasetPreparation<String[]>
Generates a train/validate/test split.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_PreserveOrderwhether to preserve the order.protected doublem_TrainPercentagethe train percentage.protected doublem_ValidatePercentagethe validate percentage.-
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 TrainValidateTestSplit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Classaccepts()Returns the class that the preparation scheme accepts as input.protected Stringcheck(String[] data)Hook method for checking the data.voiddefineOptions()Adds options to the internal list of options.protected List<FileBasedDatasetContainer>doPrepare(String[] data)Prepares the data.booleangetPreserveOrder()Returns whether to preserve the order.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.doublegetTrainPercentage()Returns the split percentage for training.doublegetValidatePercentage()Returns the split percentage for validation.StringglobalInfo()Returns a string describing the object.StringpreserveOrderTipText()Returns the tip text for this property.voidsetPreserveOrder(boolean value)Sets whether to preserve the order.voidsetTrainPercentage(double value)Sets the split percentage for training.voidsetValidatePercentage(double value)Sets the split percentage for validation.protected com.github.fracpete.javautils.struct.Struct2<String[],String[]>split(String[] data, double percentage)Splits the data using the specified percentage.StringtrainPercentageTipText()Returns the tip text for this property.StringvalidatePercentageTipText()Returns the tip text for this property.-
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, 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
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractRandomizableFileBasedDatasetPreparation<String[]>
-
setTrainPercentage
public void setTrainPercentage(double value)
Sets the split percentage for training.- Parameters:
value- the percentage (0-1)
-
getTrainPercentage
public double getTrainPercentage()
Returns the split percentage for training.- Returns:
- the percentage (0-1)
-
trainPercentageTipText
public String trainPercentageTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setValidatePercentage
public void setValidatePercentage(double value)
Sets the split percentage for validation.- Parameters:
value- the percentage (0-1)
-
getValidatePercentage
public double getValidatePercentage()
Returns the split percentage for validation.- Returns:
- the percentage (0-1)
-
validatePercentageTipText
public String validatePercentageTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPreserveOrder
public void setPreserveOrder(boolean value)
Sets whether to preserve the order.- Parameters:
value- true if to preserve order
-
getPreserveOrder
public boolean getPreserveOrder()
Returns whether to preserve the order.- Returns:
- true if to preserve order
-
preserveOrderTipText
public String preserveOrderTipText()
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 interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractFileBasedDatasetPreparation<String[]>- Returns:
- null if no info available, otherwise short string
-
accepts
public Class accepts()
Returns the class that the preparation scheme accepts as input.- Specified by:
acceptsin classAbstractFileBasedDatasetPreparation<String[]>- Returns:
- the class
-
check
protected String check(String[] data)
Hook method for checking the data.- Overrides:
checkin classAbstractFileBasedDatasetPreparation<String[]>- Parameters:
data- the data to check- Returns:
- null if succesful, otherwise error message
-
split
protected com.github.fracpete.javautils.struct.Struct2<String[],String[]> split(String[] data, double percentage)
Splits the data using the specified percentage.- Parameters:
data- the data to use- Returns:
- the generated container
-
doPrepare
protected List<FileBasedDatasetContainer> doPrepare(String[] data)
Prepares the data.- Specified by:
doPreparein classAbstractFileBasedDatasetPreparation<String[]>- Parameters:
data- the data to use- Returns:
- the generated container
-
-