Class InstancesRandomSplitGenerator
- 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.InstancesRandomSplitGenerator
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.QuickInfoSupporter
,adams.core.Randomizable
,adams.core.SizeOfHandler
,adams.flow.core.FlowContextHandler
,adams.flow.transformer.indexedsplitsrunsgenerator.IndexedSplitsRunsGenerator
,InstancesIndexedSplitsRunsGenerator
,Serializable
public class InstancesRandomSplitGenerator extends AbstractInstancesIndexedSplitsRunsGenerator implements adams.core.Randomizable
Random split generator that works on Instances objects.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double
m_Percentage
the percentage.protected boolean
m_PreserveOrder
whether to preserve the order.protected long
m_Seed
the seed value.-
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 InstancesRandomSplitGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected adams.data.indexedsplits.IndexedSplitsRuns
doGenerate(Object data, adams.core.MessageCollection errors)
Generates the indexed splits.double
getPercentage()
Returns the split percentage.boolean
getPreserveOrder()
Returns whether to preserve the order.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.long
getSeed()
Returns the seed value.String
globalInfo()
Returns a string describing the object.String
percentageTipText()
Returns the tip text for this property.String
preserveOrderTipText()
Returns the tip text for this property.String
seedTipText()
Returns the tip text for this property.void
setPercentage(double value)
Sets the split percentage.void
setPreserveOrder(boolean value)
Sets whether to preserve the order.void
setSeed(long value)
Sets the seed value.-
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
check, 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:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in 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:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classAbstractInstancesIndexedSplitsRunsGenerator
-
setPercentage
public void setPercentage(double value)
Sets the split percentage.- Parameters:
value
- the percentage (0-1)
-
getPercentage
public double getPercentage()
Returns the split percentage.- Returns:
- the percentage (0-1)
-
percentageTipText
public String percentageTipText()
Returns the tip text for this property.- 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:
setSeed
in interfaceadams.core.Randomizable
- Parameters:
value
- the seed
-
getSeed
public long getSeed()
Returns the seed value.- Specified by:
getSeed
in interfaceadams.core.Randomizable
- Returns:
- the seed
-
seedTipText
public String seedTipText()
Returns the tip text for this property.- Specified by:
seedTipText
in interfaceadams.core.Randomizable
- 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:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractInstancesIndexedSplitsRunsGenerator
- Returns:
- null if no info available, otherwise short string
-
doGenerate
protected adams.data.indexedsplits.IndexedSplitsRuns doGenerate(Object data, adams.core.MessageCollection errors)
Generates the indexed splits.- Specified by:
doGenerate
in 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
-
-