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 <> (property: rowFinder)
        The row-finder to use to select rows for the first dataset.
    Corey Sterling (csterlin at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail


        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.
        The row-finder.
      • setRowFinder

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

        public String rowFinderTipText()
        Gets the tip-text for the rowFinder option.
        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.
        dataset - The dataset to check.
        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.
        selectedIndices - The array of selected indices.
        index - The index to get from the array.
        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
        dataset - The dataset to split.
        An array of datasets resulting from the split.