Class RowSplitter

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, SizeOfHandler, Serializable

    public class RowSplitter
    extends AbstractSplitter
    Splits a dataset in two based on the rows selected by the row-finder. Instances found by the row-finder go in the first dataset, and the rest go in the second.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -row-finder <adams.data.weka.rowfinder.RowFinder> (property: rowFinder)
        The row-finder to use to select rows for the first dataset.
        default: adams.data.weka.rowfinder.NullFinder
     
    Author:
    Corey Sterling (csterlin at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • NO_NEXT_SELECTED_INDEX

        public static final int NO_NEXT_SELECTED_INDEX
        Sentinel for when there's no more selected rows.
        See Also:
        Constant Field Values
      • m_RowFinder

        protected RowFinder m_RowFinder
        The selector for splitting rows between the two datasets.
    • Constructor Detail

      • RowSplitter

        public RowSplitter()
    • Method Detail

      • getRowFinder

        public RowFinder getRowFinder()
        Gets the row-finder to use to select rows for the first dataset.
        Returns:
        The row-finder.
      • setRowFinder

        public void setRowFinder​(RowFinder value)
        Sets the row-finder to use to select rows for the first dataset.
        Parameters:
        value - The row-finder.
      • rowFinderTipText

        public String rowFinderTipText()
        Gets the tip-text for the rowFinder option.
        Returns:
        The tip-text as a string.
      • check

        public String check​(weka.core.Instances dataset)
        Checks that the input data is correctly formatted for our purposes.
        Parameters:
        dataset - The dataset to check.
        Returns:
        Null if all okay, or an error message if not.
      • getNextSelectedIndex

        protected int getNextSelectedIndex​(int[] selectedIndices,
                                           int index)
        Gets the next index selected by the row-finder.
        Parameters:
        selectedIndices - The array of selected indices.
        index - The index to get from the array.
        Returns:
        The next selected row-index, or NO_NEXT_SELECTED_INDEX if there isn't one.
      • split

        public weka.core.Instances[] split​(weka.core.Instances dataset)
        Splits the given dataset into a number of other datasets. Should be implemented by sub-classes to perform actual splitting.
        Specified by:
        split in class AbstractSplitter
        Parameters:
        dataset - The dataset to split.
        Returns:
        An array of datasets resulting from the split.