Class WekaChooseAttributes

    • Field Detail

      • m_Message

        protected String m_Message
        the message to display to the user.
      • m_PreSelection

        protected BaseRegExp m_PreSelection
        the regular expression for pre-selecting attributes by name.
      • m_NonInteractive

        protected boolean m_NonInteractive
        whether to automate the actor.
      • m_Remove

        protected weka.filters.unsupervised.attribute.Remove m_Remove
        the Remove filter in use.
    • Constructor Detail

      • WekaChooseAttributes

        public WekaChooseAttributes()
    • Method Detail

      • setMessage

        public void setMessage​(String value)
        Sets the message to display to the user (variables get expanded).
        Parameters:
        value - the message
      • getMessage

        public String getMessage()
        Returns the message to display to the user (variables get expanded).
        Returns:
        the message
      • messageTipText

        public String messageTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setPreSelection

        public void setPreSelection​(BaseRegExp value)
        Sets the regular expression to pre-select attributes for the dialog.
        Parameters:
        value - the expression
      • isPreSelection

        public BaseRegExp isPreSelection()
        Returns the regular expression to pre-select attributes for the dialog.
        Returns:
        the expression
      • preSelectionTipText

        public String preSelectionTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Specified by:
        accepts in interface InputConsumer
        Returns:
        the Class of objects that can be processed
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Specified by:
        generates in interface OutputProducer
        Returns:
        the Class of the generated tokens
      • selectAttributes

        protected List<Integer> selectAttributes​(weka.core.Instances inst,
                                                 List<Integer> preSelected)
        Prompts the user to select attributes.
        Parameters:
        inst - the data to present
        preSelected - the indices of the attributes to use by default
        Returns:
        the list of selected attributes to keep, null if cancelled
      • getPreSelectedIndices

        protected List<Integer> getPreSelectedIndices​(weka.core.Instances inst)
        Returns the pre-selected indices.
        Parameters:
        inst - the dataset to work on
        Returns:
        the indices
      • filter

        protected weka.core.Instances filter​(weka.core.Instances inst,
                                             List<Integer> selected)
                                      throws Exception
        Filters the data.
        Parameters:
        inst - the data to filter
        selected - the selected attributes
        Returns:
        the new dataset
        Throws:
        Exception - in case filtering fails
      • generateOutput

        protected boolean generateOutput​(weka.core.Instances inst,
                                         List<Integer> selected)
        Creates the output token with the subset of data.
        Parameters:
        inst - the instances to process
        selected - the indices to select
        Returns:
        true if successfully generated