Class InstanceComparePanel.DatasetIndexer

    • Field Detail

      • MAX_DECIMAL

        public static final int MAX_DECIMAL
        the maximum number of decimals after the decimal point to use.
        See Also:
        Constant Field Values
      • m_Dataset

        protected weka.core.Instances m_Dataset
        the underlying dataset.
      • m_AttributeIndex

        protected Index m_AttributeIndex
        the attribute to index.
      • m_Range

        protected Range m_Range
        the range of attributes to use.
      • m_IsString

        protected Boolean m_IsString
        whether the attribute is numeric or string/nominal.
      • m_Remove

        protected weka.filters.unsupervised.attribute.Remove m_Remove
        the remove filter for trimming the range of attributes to return.
    • Constructor Detail

      • DatasetIndexer

        public DatasetIndexer()
        Initializes the indexer.
    • Method Detail

      • reset

        protected void reset()
        Invalidates the indexer.
      • setDataset

        public void setDataset​(weka.core.Instances value)
        Sets the dataset to index.
        Parameters:
        value - the dataset
      • getDataset

        public weka.core.Instances getDataset()
        Returns the dataset to index.
        Returns:
        the dataset
      • hasAttributeIndex

        public boolean hasAttributeIndex()
        Checks whether an attribute index has been set.
        Returns:
        true if an attribute index has been set
      • setAttributeIndex

        public void setAttributeIndex​(String value)
        Sets the index of the attribute to use for indexing.
        Parameters:
        value - the index
      • getAttributeIndex

        public String getAttributeIndex()
        Returns the index of the attribute to use for indexing.
        Returns:
        the index
      • setRange

        public void setRange​(String value)
        Sets the range of attributes to use.
        Parameters:
        value - the range
      • getRange

        public String getRange()
        Returns the range of attributes to use.
        Returns:
        the range
      • initialize

        protected void initialize()
        Initializes the indexer, if necessary.
      • isString

        public boolean isString()
        Returns whether the sort index is nominal/string or numeric.
        Returns:
        true if string/nominal
      • getIndex

        public TreeMap<String,​Integer> getIndex()
        Returns the index, generates it if necessary.
        Returns:
        the generated index
      • getRows

        public List<String> getRows()
        Returns a list of row IDs.
        Returns:
        the available IDs
      • getRow

        public Instance getRow​(String row)
        Returns the Instance for the row.
        Parameters:
        row - the row to retrieve
        Returns:
        the row or null if not found or failed to filter