Class AbstractSplitGenerator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected weka.core.Instances m_Data
      the original dataset.
      protected boolean m_Initialized
      whether the iterator has been initialized.
      protected gnu.trove.list.TIntList m_OriginalIndices
      the original indicies.
      protected long m_Seed
      the seed value.
      protected boolean m_UseViews
      whether to use views.
      • 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 
      Modifier Constructor Description
      protected AbstractSplitGenerator()
      Initializes the generator.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract boolean canRandomize()
      Returns whether randomization is enabled.
      protected abstract boolean checkNext()
      Returns true if the iteration has more elements.
      protected abstract WekaTrainTestSetContainer createNext()
      Creates the next result.
      void defineOptions()
      Adds options to the internal list of options.
      protected abstract void doInitializeIterator()
      Initializes the iterator, randomizes the data if required.
      weka.core.Instances getData()
      Returns the original data.
      long getSeed()
      Returns the seed value.
      boolean getUseViews()
      Returns whether to use views.
      boolean hasNext()
      Returns true if the iteration has more elements.
      protected void initialize()
      Initializes the members.
      void initializeIterator()
      Initializes the iterator, randomizes the data if required.
      WekaTrainTestSetContainer next()
      Returns the next element in the iteration.
      protected void randomize​(gnu.trove.list.TIntList indices, Random random)
      Randomizes the indices using the given random number generator.
      void remove()
      Unsupported.
      protected void reset()
      Resets the generator.
      String seedTipText()
      Returns the tip text for this property.
      void setData​(weka.core.Instances value)
      Sets the original data.
      void setSeed​(long value)
      Sets the seed value.
      void setUseViews​(boolean value)
      Sets whether to uses views only.
      String toString()
      Returns a short description of the generator.
      String useViewsTipText()
      Returns the tip text for this property.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.Destroyable

        destroy
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
      • Methods inherited from interface adams.core.option.OptionHandler

        cleanUpOptions, getOptionManager, toCommandLine
    • Field Detail

      • m_Seed

        protected long m_Seed
        the seed value.
      • m_UseViews

        protected boolean m_UseViews
        whether to use views.
      • m_Data

        protected weka.core.Instances m_Data
        the original dataset.
      • m_Initialized

        protected boolean m_Initialized
        whether the iterator has been initialized.
      • m_OriginalIndices

        protected gnu.trove.list.TIntList m_OriginalIndices
        the original indicies.
    • Constructor Detail

      • AbstractSplitGenerator

        protected AbstractSplitGenerator()
        Initializes the generator.
    • Method Detail

      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class adams.core.option.AbstractOptionHandler
      • reset

        protected void reset()
        Resets the generator.
        Overrides:
        reset in class adams.core.option.AbstractOptionHandler
      • setData

        public void setData​(weka.core.Instances value)
        Sets the original data.
        Specified by:
        setData in interface adams.data.splitgenerator.SplitGenerator<weka.core.Instances,​WekaTrainTestSetContainer>
        Specified by:
        setData in interface SplitGenerator
        Parameters:
        value - the data
      • getData

        public weka.core.Instances getData()
        Returns the original data.
        Specified by:
        getData in interface adams.data.splitgenerator.SplitGenerator<weka.core.Instances,​WekaTrainTestSetContainer>
        Specified by:
        getData in interface SplitGenerator
        Returns:
        the data
      • setSeed

        public void setSeed​(long value)
        Sets the seed value.
        Specified by:
        setSeed in interface adams.core.Randomizable
        Parameters:
        value - the seed
      • getSeed

        public long getSeed()
        Returns the seed value.
        Specified by:
        getSeed in interface adams.core.Randomizable
        Returns:
        the seed
      • seedTipText

        public String seedTipText()
        Returns the tip text for this property.
        Specified by:
        seedTipText in interface adams.core.Randomizable
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setUseViews

        public void setUseViews​(boolean value)
        Sets whether to uses views only.
        Specified by:
        setUseViews in interface InstancesViewSupporter
        Parameters:
        value - true if to uses views
      • getUseViews

        public boolean getUseViews()
        Returns whether to use views.
        Specified by:
        getUseViews in interface InstancesViewSupporter
        Returns:
        true if to uses views
      • useViewsTipText

        public String useViewsTipText()
        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 abstract boolean canRandomize()
        Returns whether randomization is enabled.
        Returns:
        true if to randomize
      • checkNext

        protected abstract 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.)
        Returns:
        true if the iterator has more elements.
      • hasNext

        public boolean hasNext()
        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:
        hasNext in interface Iterator<WekaTrainTestSetContainer>
        Specified by:
        hasNext in interface adams.data.splitgenerator.SplitGenerator<weka.core.Instances,​WekaTrainTestSetContainer>
        Specified by:
        hasNext in interface SplitGenerator
        Returns:
        true if the iterator has more elements.
      • randomize

        protected void randomize​(gnu.trove.list.TIntList indices,
                                 Random random)
        Randomizes the indices using the given random number generator.
        Parameters:
        indices - the indices to randomize inplace
        random - the random number generator to use
      • doInitializeIterator

        protected abstract void doInitializeIterator()
        Initializes the iterator, randomizes the data if required.
        See Also:
        canRandomize()
      • toString

        public String toString()
        Returns a short description of the generator.
        Specified by:
        toString in interface adams.data.splitgenerator.SplitGenerator<weka.core.Instances,​WekaTrainTestSetContainer>
        Specified by:
        toString in interface SplitGenerator
        Overrides:
        toString in class adams.core.option.AbstractOptionHandler
        Returns:
        a short description