Package weka.classifiers
Class BestBinnedNumericClassRandomSplitGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- weka.classifiers.AbstractSplitGenerator
-
- weka.classifiers.BestBinnedNumericClassRandomSplitGenerator
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,Randomizable
,SizeOfHandler
,RandomSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>
,SplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>
,InstancesViewSupporter
,Serializable
,Iterator<WekaTrainTestSetContainer>
,RandomSplitGenerator
,SplitGenerator
public class BestBinnedNumericClassRandomSplitGenerator extends AbstractSplitGenerator implements RandomSplitGenerator
Picks the best binning algorithm from the provided ones.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BinningAlgorithm[]
m_Algorithms
the algorithms to evaluate.protected boolean
m_Generated
whether the split was generated.protected ManualBinning
m_Manual
for generating class distributions.protected int
m_NumEvaluationBins
the number of evaluation bins.protected double
m_Percentage
the percentage.protected boolean
m_PreserveOrder
whether to preserve the order.-
Fields inherited from class weka.classifiers.AbstractSplitGenerator
m_Data, m_Initialized, m_OriginalIndices, 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 BestBinnedNumericClassRandomSplitGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
algorithmsTipText()
Returns the tip text for this property.protected double[]
calcDistribution(List<Binnable<weka.core.Instance>> binnable, double emptyBinValue)
Calculates the class distribution.protected boolean
canRandomize()
Returns whether randomization is enabled.protected boolean
checkNext()
Returns true if the iteration has more elements.protected WekaTrainTestSetContainer
createNext()
Creates the next result.void
defineOptions()
Adds options to the internal list of options.protected void
doInitializeIterator()
Initializes the iterator.BinningAlgorithm[]
getAlgorithms()
Returns the binning algorithms to choose from.int
getNumEvaluationBins()
Returns the number of bins to use during evaluation.double
getPercentage()
Returns the split percentage.boolean
getPreserveOrder()
Returns whether to preserve the order.String
globalInfo()
Returns a string describing the object.String
numEvaluationBinsTipText()
Returns the tip text for this property.String
percentageTipText()
Returns the tip text for this property.String
preserveOrderTipText()
Returns the tip text for this property.void
setAlgorithms(BinningAlgorithm[] value)
Sets the binning algorithms to choose from.void
setNumEvaluationBins(int value)
Sets the number of bints to use during evaluation.void
setPercentage(double value)
Sets the split percentage.void
setPreserveOrder(boolean value)
Sets whether to preserve the order.-
Methods inherited from class weka.classifiers.AbstractSplitGenerator
getData, getSeed, getUseViews, hasNext, initialize, initializeIterator, next, randomize, remove, reset, seedTipText, setData, setSeed, setUseViews, toString, 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, setData, toString
-
-
-
-
Field Detail
-
m_Percentage
protected double m_Percentage
the percentage.
-
m_PreserveOrder
protected boolean m_PreserveOrder
whether to preserve the order.
-
m_Algorithms
protected BinningAlgorithm[] m_Algorithms
the algorithms to evaluate.
-
m_NumEvaluationBins
protected int m_NumEvaluationBins
the number of evaluation bins.
-
m_Generated
protected boolean m_Generated
whether the split was generated.
-
m_Manual
protected ManualBinning m_Manual
for generating class distributions.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- 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 classAbstractSplitGenerator
-
setPercentage
public void setPercentage(double value)
Sets the split percentage.- Specified by:
setPercentage
in interfaceRandomSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- Specified by:
setPercentage
in interfaceRandomSplitGenerator
- Parameters:
value
- the percentage (0-1)
-
getPercentage
public double getPercentage()
Returns the split percentage.- Specified by:
getPercentage
in interfaceRandomSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- Specified by:
getPercentage
in 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:
setPreserveOrder
in interfaceRandomSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- Specified by:
setPreserveOrder
in interfaceRandomSplitGenerator
- Parameters:
value
- true if to preserve order
-
getPreserveOrder
public boolean getPreserveOrder()
Returns whether to preserve the order.- Specified by:
getPreserveOrder
in interfaceRandomSplitGenerator<weka.core.Instances,WekaTrainTestSetContainer>
- Specified by:
getPreserveOrder
in 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.
-
setAlgorithms
public void setAlgorithms(BinningAlgorithm[] value)
Sets the binning algorithms to choose from.- Parameters:
value
- the algorithms
-
getAlgorithms
public BinningAlgorithm[] getAlgorithms()
Returns the binning algorithms to choose from.- Returns:
- the algorithms
-
algorithmsTipText
public String algorithmsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumEvaluationBins
public void setNumEvaluationBins(int value)
Sets the number of bints to use during evaluation.- Parameters:
value
- the number of bins
-
getNumEvaluationBins
public int getNumEvaluationBins()
Returns the number of bins to use during evaluation.- Returns:
- the number of bins
-
numEvaluationBinsTipText
public String numEvaluationBinsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
canRandomize
protected boolean canRandomize()
Returns whether randomization is enabled.- Specified by:
canRandomize
in classAbstractSplitGenerator
- Returns:
- true if to randomize
-
doInitializeIterator
protected void doInitializeIterator()
Initializes the iterator.- Specified by:
doInitializeIterator
in 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:
checkNext
in classAbstractSplitGenerator
- Returns:
- true if the iterator has more elements.
-
calcDistribution
protected double[] calcDistribution(List<Binnable<weka.core.Instance>> binnable, double emptyBinValue)
Calculates the class distribution.- Parameters:
binnable
- the instances to calculate the distribution foremptyBinValue
- the value to use for empty bins- Returns:
- the distribution
-
createNext
protected WekaTrainTestSetContainer createNext()
Creates the next result.- Specified by:
createNext
in classAbstractSplitGenerator
- Returns:
- the next result
-
-