Class SimpleInstanceGenerator

  • All Implemented Interfaces:
    adams.core.CleanUpHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.ShallowCopySupporter<adams.data.instances.AbstractInstanceGenerator>, adams.core.SizeOfHandler, adams.data.instances.InstanceGeneratorWithAdditionalFields, InstanceGeneratorWithClassLabels, InstanceGeneratorWithSampleID, InstanceGeneratorWithTargetField, adams.db.DatabaseConnectionHandler, adams.db.DatabaseConnectionProvider, adams.db.DatabaseConnectionUser, adams.db.OptionalDatabaseConnectionUser, Serializable, Comparable

    public class SimpleInstanceGenerator
    extends AbstractSpectrumInstanceGeneratorWithClass
    A simple scheme for turning spectra and fields of the associated sample data into weka.core.Instance objects.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -add-db-id <boolean> (property: addDatabaseID)
        If set to true, then the database ID will be added to the output.
        default: false
     
    -tolerate-header-changes <boolean> (property: tolerateHeaderChanges)
        If set to true, then changes in the header get tolerated (and the header
        recreated) instead of causing an error.
        default: false
     
    -offline <boolean> (property: offline)
        If set to true, the generator operates in offline mode, ie does not access
        database.
        default: false
     
    -add-sample-id <boolean> (property: addSampleID)
        If set to true, then the sample ID will be added to the output.
        default: false
     
    -notes <adams.core.base.BaseString> [-notes ...] (property: notes)
        The notes to add as attributes to the generated data, eg 'PROCESS INFORMATION'
        .
        default:
     
    -load-sample-data <boolean> (property: loadSampleData)
        If set to true, then the sample data will be loaded if only dummy report
        available, using the sample ID.
        default: false
     
    -additional <adams.data.report.Field> [-additional ...] (property: additionalFields)
        The additional fields from the sample data to add to the output.
        default:
     
    -no-additional-prefix <boolean> (property: noAdditionalFieldsPrefix)
        If enabled, the additional fields won't get a prefix for their name.
        default: false
     
    -field <adams.data.report.Field> (property: field)
        The field to act as class attribute.
        default: ADN1[N]
     
    -class-label <adams.core.base.BaseString> [-class-label ...] (property: classLabels)
        The class labels to use for a nominal class.
        default:
     
    -add-wave <boolean> (property: addWaveNumber)
        If enabled, the wave number will be added to the output data as well.
        default: false
     
    -wave-number-as-suffix <boolean> (property: waveNumberAsSuffix)
        If enabled, the wave number is used as suffix instead of the index.
        default: false
     
    Version:
    $Revision: 2242 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_AddWaveNumber

        protected boolean m_AddWaveNumber
        whether to output the wave-number as well.
      • m_WaveNumberAsSuffix

        protected boolean m_WaveNumberAsSuffix
        whether to use the wave number as suffix.
    • Constructor Detail

      • SimpleInstanceGenerator

        public SimpleInstanceGenerator()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • setAddWaveNumber

        public void setAddWaveNumber​(boolean value)
        Sets whether the wave number gets added to the output data as well.
        Parameters:
        value - true if wave number should be output as well
      • getAddWaveNumber

        public boolean getAddWaveNumber()
        Returns whether the wave number gets added to the output as well.
        Returns:
        true if wave number will be output as well
      • addWaveNumberTipText

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

        public void setWaveNumberAsSuffix​(boolean value)
        Sets whether the wave number is used as suffix instead of the index.
        Parameters:
        value - true if to use wave number
      • getWaveNumberAsSuffix

        public boolean getWaveNumberAsSuffix()
        Returns whether the wave number is used as suffix instead of the index.
        Returns:
        true if to use wave number
      • waveNumberAsSuffixTipText

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

        protected weka.core.Instance generateOutput​(Spectrum data)
        Generates the actual data.
        Specified by:
        generateOutput in class adams.data.instances.AbstractInstanceGenerator<Spectrum>
        Parameters:
        data - the input data to transform
        Returns:
        the generated data