Package weka.classifiers
Class BinnedNumericClassRandomSplitGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- weka.classifiers.AbstractSplitGenerator
-
- weka.classifiers.BinnedNumericClassRandomSplitGenerator
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,Randomizable,SizeOfHandler,BinningAlgorithmUser,RandomSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>,SplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>,InstancesViewSupporter,Serializable,Iterator<WekaTrainTestSetContainer>,RandomSplitGenerator,SplitGenerator
public class BinnedNumericClassRandomSplitGenerator extends AbstractSplitGenerator implements RandomSplitGenerator, BinningAlgorithmUser
Generates random splits of datasets with numeric classes using a binning algorithm.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BinningAlgorithmm_Algorithmthe binning algorithm.protected booleanm_Generatedwhether the split was generated.protected doublem_Percentagethe percentage.protected booleanm_PreserveOrderwhether to preserve the order.-
Fields inherited from class weka.classifiers.AbstractSplitGenerator
m_Data, m_Initialized, m_OriginalIndices, m_OriginalIndicesPerFold, m_Seed, m_UseViews
-
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 BinnedNumericClassRandomSplitGenerator()Initializes the generator.BinnedNumericClassRandomSplitGenerator(weka.core.Instances data, BinningAlgorithm algorithm, double percentage)Initializes the generator.BinnedNumericClassRandomSplitGenerator(weka.core.Instances data, BinningAlgorithm algorithm, long seed, double percentage)Initializes the generator.BinnedNumericClassRandomSplitGenerator(weka.core.Instances data, BinningAlgorithm algorithm, long seed, double percentage, boolean preserveOrder)Initializes the generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringalgorithmTipText()Returns the tip text for this property.protected booleancanRandomize()Returns whether randomization is enabled.protected booleancheckNext()Returns true if the iteration has more elements.protected WekaTrainTestSetContainercreateNext()Creates the next result.voiddefineOptions()Adds options to the internal list of options.protected voiddoInitializeIterator()Initializes the iterator.BinningAlgorithmgetAlgorithm()Returns the binning algorithm.doublegetPercentage()Returns the split percentage.booleangetPreserveOrder()Returns whether to preserve the order.StringglobalInfo()Returns a string describing the object.StringpercentageTipText()Returns the tip text for this property.StringpreserveOrderTipText()Returns the tip text for this property.voidsetAlgorithm(BinningAlgorithm value)Sets the binning algorithm.voidsetData(weka.core.Instances value)Sets the original data.voidsetPercentage(double value)Sets the split percentage.voidsetPreserveOrder(boolean value)Sets whether to preserve the order.StringtoString()Returns a short description of the generator.-
Methods inherited from class weka.classifiers.AbstractSplitGenerator
getData, getSeed, getUseViews, hasNext, initialize, initializeIterator, next, randomize, remove, reset, seedTipText, setSeed, setUseViews, useViewsTipText
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine
-
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.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.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.core.Randomizable
getSeed, seedTipText, setSeed
-
Methods inherited from interface weka.classifiers.SplitGenerator
getData, hasNext, initializeIterator, next, remove
-
-
-
-
Field Detail
-
m_Percentage
protected double m_Percentage
the percentage.
-
m_PreserveOrder
protected boolean m_PreserveOrder
whether to preserve the order.
-
m_Algorithm
protected BinningAlgorithm m_Algorithm
the binning algorithm.
-
m_Generated
protected boolean m_Generated
whether the split was generated.
-
-
Constructor Detail
-
BinnedNumericClassRandomSplitGenerator
public BinnedNumericClassRandomSplitGenerator()
Initializes the generator.
-
BinnedNumericClassRandomSplitGenerator
public BinnedNumericClassRandomSplitGenerator(weka.core.Instances data, BinningAlgorithm algorithm, long seed, double percentage)Initializes the generator. Does not preserve the order.- Parameters:
data- the dataset to splitalgorithm- the algorithm to useseed- the seed value to use for randomizationpercentage- the percentage of the training set (0-1)
-
BinnedNumericClassRandomSplitGenerator
public BinnedNumericClassRandomSplitGenerator(weka.core.Instances data, BinningAlgorithm algorithm, double percentage)Initializes the generator. Preserves the order.- Parameters:
data- the dataset to splitalgorithm- the algorithm to usepercentage- the percentage of the training set (0-1)
-
BinnedNumericClassRandomSplitGenerator
public BinnedNumericClassRandomSplitGenerator(weka.core.Instances data, BinningAlgorithm algorithm, long seed, double percentage, boolean preserveOrder)Initializes the generator.- Parameters:
data- the dataset to splitalgorithm- the algorithm to useseed- the seed value to use for randomizationpercentage- the percentage of the training set (0-1)preserveOrder- whether to preserve the order
-
-
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 classAbstractSplitGenerator
-
setPercentage
public void setPercentage(double value)
Sets the split percentage.- Specified by:
setPercentagein interfaceRandomSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>- Specified by:
setPercentagein interfaceRandomSplitGenerator- Parameters:
value- the percentage (0-1)
-
getPercentage
public double getPercentage()
Returns the split percentage.- Specified by:
getPercentagein interfaceRandomSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>- Specified by:
getPercentagein interfaceRandomSplitGenerator- 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.
-
setPreserveOrder
public void setPreserveOrder(boolean value)
Sets whether to preserve the order.- Specified by:
setPreserveOrderin interfaceRandomSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>- Specified by:
setPreserveOrderin interfaceRandomSplitGenerator- Parameters:
value- true if to preserve order
-
getPreserveOrder
public boolean getPreserveOrder()
Returns whether to preserve the order.- Specified by:
getPreserveOrderin interfaceRandomSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>- Specified by:
getPreserveOrderin interfaceRandomSplitGenerator- 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.
-
setAlgorithm
public void setAlgorithm(BinningAlgorithm value)
Sets the binning algorithm.- Specified by:
setAlgorithmin interfaceBinningAlgorithmUser- Parameters:
value- the algorithm
-
getAlgorithm
public BinningAlgorithm getAlgorithm()
Returns the binning algorithm.- Specified by:
getAlgorithmin interfaceBinningAlgorithmUser- Returns:
- the algorithm
-
algorithmTipText
public String algorithmTipText()
Returns the tip text for this property.- Specified by:
algorithmTipTextin interfaceBinningAlgorithmUser- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setData
public void setData(weka.core.Instances value)
Sets the original data.- Specified by:
setDatain interfaceSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>- Specified by:
setDatain interfaceSplitGenerator- Overrides:
setDatain classAbstractSplitGenerator- Parameters:
value- the data
-
canRandomize
protected boolean canRandomize()
Returns whether randomization is enabled.- Specified by:
canRandomizein classAbstractSplitGenerator- Returns:
- true if to randomize
-
doInitializeIterator
protected void doInitializeIterator()
Initializes the iterator.- Specified by:
doInitializeIteratorin classAbstractSplitGenerator- See Also:
AbstractSplitGenerator.canRandomize()
-
checkNext
protected boolean checkNext()
Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)- Specified by:
checkNextin classAbstractSplitGenerator- Returns:
- true if the iterator has more elements.
-
createNext
protected WekaTrainTestSetContainer createNext()
Creates the next result.- Specified by:
createNextin classAbstractSplitGenerator- Returns:
- the next result
-
toString
public String toString()
Returns a short description of the generator.- Specified by:
toStringin interfaceSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>- Specified by:
toStringin interfaceSplitGenerator- Overrides:
toStringin classAbstractSplitGenerator- Returns:
- a short description
-
-