Package adams.ml.data

Interface Dataset

    • Method Detail

      • getHeader

        Dataset getHeader()
        Returns the a spreadsheet with the same header and comments.
        Specified by:
        getHeader in interface SpreadSheet
        Returns:
        the spreadsheet
      • indexOfColumn

        int indexOfColumn​(String name)
        Returns the index of the column using the specified name.
        Parameters:
        name - the name of the column to locate
        Returns:
        the index, -1 if failed to locate
      • removeClassAttributes

        void removeClassAttributes()
        Removes all set class attributes.
      • isClassAttribute

        boolean isClassAttribute​(String colKey)
        Returns whether the specified column is a class attribute.
        Parameters:
        colKey - they key of the column to query
        Returns:
        true if column a class attribute
      • isClassAttributeByName

        boolean isClassAttributeByName​(String name)
        Returns whether the specified column is a class attribute.
        Parameters:
        name - they name of the column to query
        Returns:
        true if column a class attribute
      • isClassAttribute

        boolean isClassAttribute​(int colIndex)
        Returns whether the specified column is a class attribute.
        Parameters:
        colIndex - they index of the column to query
        Returns:
        true if column a class attribute
      • setClassAttribute

        boolean setClassAttribute​(String colKey,
                                  boolean isClass)
        Sets the class attribute status for a column.
        Parameters:
        colKey - the column to set the class attribute status for
        isClass - if true then the column will be flagged as class attribute, otherwise the flag will get removed
        Returns:
        true if successfully updated
      • setClassAttributeByName

        boolean setClassAttributeByName​(String name,
                                        boolean isClass)
        Sets the class attribute status for a column.
        Parameters:
        name - the name of the column to set the class attribute status for
        isClass - if true then the column will be flagged as class attribute, otherwise the flag will get removed
        Returns:
        true if successfully updated
      • setClassAttribute

        boolean setClassAttribute​(int colIndex,
                                  boolean isClass)
        Sets the class attribute status for a column.
        Parameters:
        colIndex - the column to set the class attribute status for
        isClass - if true then the column will be flagged as class attribute, otherwise the flag will get removed
        Returns:
        true if successfully updated
      • getClassAttributeKeys

        String[] getClassAttributeKeys()
        Returns all the class attributes that are currently set.
        Returns:
        the column keys of class attributes (not ordered)
      • getClassAttributeNames

        String[] getClassAttributeNames()
        Returns all the class attributes that are currently set.
        Returns:
        the column names of class attributes (not ordered)
      • getClassAttributeIndices

        int[] getClassAttributeIndices()
        Returns all the class attributes that are currently set.
        Returns:
        the indices of class attributes (sorted asc)
      • getInputs

        SpreadSheet getInputs()
        Returns a spreadsheet containing only the input columns, not class columns.
        Returns:
        the input features, null if data conists only of class columns
      • getOutputs

        SpreadSheet getOutputs()
        Returns a spreadsheet containing only output columns, i.e., the class columns.
        Returns:
        the output features, null if data has no class columns