Package adams.data.instances
Class ArffUtils
- java.lang.Object
-
- adams.data.weka.ArffUtils
-
- adams.data.instances.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)
-
-
Field Summary
Fields Modifier and Type Field Description static String
PREFIX_AMPLITUDE
static String
PREFIX_WAVE_NUMBER
static String
SAMPLE_ID
-
Constructor Summary
Constructors Constructor Description ArffUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getAmplitudeName(float waveno)
Returns the name of an attribute for an amplitude.static String
getAmplitudeName(int index)
Returns the name of an attribute for an amplitude.static String
getAmplitudeName(String prefix, float waveno)
Returns the name of an attribute for an amplitude.static String
getAmplitudeName(String prefix, int index)
Returns the name of an attribute for an amplitude.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.static String
getSampleIDName()
Returns the name of the attribute containing the sample ID of the spectrum.static String
getWaveNumberName(float waveno)
Returns the name of an attribute for a wave number.static String
getWaveNumberName(int index)
Returns the name of an attribute for a wave number.static String
getWaveNumberName(String prefix, float waveno)
Returns the name of an attribute for a wave number.static String
getWaveNumberName(String prefix, int index)
Returns the name of an attribute for a wave number.
-
-
-
Field Detail
-
SAMPLE_ID
public static final String SAMPLE_ID
- See Also:
- Constant Field Values
-
PREFIX_WAVE_NUMBER
public static final String PREFIX_WAVE_NUMBER
- See Also:
- Constant Field Values
-
PREFIX_AMPLITUDE
public static final String PREFIX_AMPLITUDE
- See Also:
- Constant Field Values
-
-
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 useindex
- 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 usewaveno
- 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 useindex
- 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 usewaveno
- 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
-
-