Class ArffUtils


  • public class ArffUtils
    extends adams.data.weka.ArffUtils
    A helper class for turning spectrum data into ARFF files and vice versa.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • ArffUtils

        public ArffUtils()
    • Method Detail

      • getSampleIDName

        public static String getSampleIDName()
        Returns the name of the attribute containing the sample ID of the spectrum.
        Returns:
        the attribute name
      • getWaveNumberName

        public static String getWaveNumberName​(int index)
        Returns the name of an attribute for a wave number. Gets prefixed with "wave-number-".
        Parameters:
        index - the 0-based index
        Returns:
        the attribute name
        See Also:
        PREFIX_WAVE_NUMBER
      • getWaveNumberName

        public static String getWaveNumberName​(String prefix,
                                               int index)
        Returns the name of an attribute for a wave number. Gets prefixed with the specified prefix.
        Parameters:
        prefix - the prefix string to use
        index - the 0-based index
        Returns:
        the attribute name
      • getWaveNumberName

        public static String getWaveNumberName​(float waveno)
        Returns the name of an attribute for a wave number. Gets prefixed with "wave-number-".
        Parameters:
        waveno - the wave number
        Returns:
        the attribute name
        See Also:
        PREFIX_WAVE_NUMBER
      • getWaveNumberName

        public static String getWaveNumberName​(String prefix,
                                               float waveno)
        Returns the name of an attribute for a wave number. Gets prefixed with the specified prefix.
        Parameters:
        prefix - the prefix string to use
        waveno - the wave number
        Returns:
        the attribute name
      • getAmplitudeName

        public static String getAmplitudeName​(int index)
        Returns the name of an attribute for an amplitude. Gets prefixed with "amplitude-".
        Parameters:
        index - the 0-based index
        Returns:
        the attribute name
        See Also:
        PREFIX_AMPLITUDE
      • getAmplitudeName

        public static String getAmplitudeName​(String prefix,
                                              int index)
        Returns the name of an attribute for an amplitude. Gets prefixed with the specified prefix.
        Parameters:
        prefix - the prefix string to use
        index - the 0-based index
        Returns:
        the attribute name
      • getAmplitudeName

        public static String getAmplitudeName​(float waveno)
        Returns the name of an attribute for an amplitude. Gets prefixed with "amplitude-".
        Parameters:
        waveno - the wave number
        Returns:
        the attribute name
      • getAmplitudeName

        public static String getAmplitudeName​(String prefix,
                                              float waveno)
        Returns the name of an attribute for an amplitude. Gets prefixed with the specified prefix.
        Parameters:
        prefix - the prefix string to use
        waveno - the wave number
        Returns:
        the attribute name
      • getRemoveFilter

        public static weka.filters.unsupervised.attribute.Remove getRemoveFilter​(weka.core.Instances data)
        Initializes the Remove filter for removing all IDs (and string attributes) from the dataset.
        Parameters:
        data - the data to use for the analysis
        Returns:
        the configured filter, null if no filtering required
        Throws:
        Exception - if filter setup fails