Package adams.data.instances
Class SimpleInstanceGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.instances.AbstractInstanceGenerator<Spectrum>
-
- adams.data.instances.AbstractSpectrumBasedInstanceGenerator
-
- adams.data.instances.AbstractSpectrumInstanceGenerator
-
- adams.data.instances.AbstractSpectrumInstanceGeneratorWithClass
-
- adams.data.instances.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 Summary
Fields Modifier and Type Field Description protected boolean
m_AddWaveNumber
whether to output the wave-number as well.protected boolean
m_WaveNumberAsSuffix
whether to use the wave number as suffix.-
Fields inherited from class adams.data.instances.AbstractSpectrumInstanceGeneratorWithClass
m_ClassLabels, m_Field
-
Fields inherited from class adams.data.instances.AbstractSpectrumInstanceGenerator
m_AdditionalFields, m_AmplitudePrefix, m_NoAdditionalFieldsPrefix, m_WaveNumberPrefix
-
Fields inherited from class adams.data.instances.AbstractSpectrumBasedInstanceGenerator
m_AddSampleID, m_LoadSampleData, m_Notes
-
-
Constructor Summary
Constructors Constructor Description SimpleInstanceGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
addWaveNumberTipText()
Returns the tip text for this property.protected void
checkHeader(Spectrum data)
Checks whether the number of waves are the same.void
defineOptions()
Adds options to the internal list of options.protected void
generateHeader(Spectrum data)
Generates the header of the output data.protected weka.core.Instance
generateOutput(Spectrum data)
Generates the actual data.boolean
getAddWaveNumber()
Returns whether the wave number gets added to the output as well.boolean
getWaveNumberAsSuffix()
Returns whether the wave number is used as suffix instead of the index.String
globalInfo()
Returns a string describing the object.void
setAddWaveNumber(boolean value)
Sets whether the wave number gets added to the output data as well.void
setWaveNumberAsSuffix(boolean value)
Sets whether the wave number is used as suffix instead of the index.String
waveNumberAsSuffixTipText()
Returns the tip text for this property.-
Methods inherited from class adams.data.instances.AbstractSpectrumInstanceGeneratorWithClass
classLabelsTipText, fieldTipText, getAdditionalFieldsPosition, getClassLabels, getField, setClassLabels, setField
-
Methods inherited from class adams.data.instances.AbstractSpectrumInstanceGenerator
addField, additionalFieldsTipText, amplitudePrefixTipText, getAdditionalFields, getAdditionalFieldsPrefix, getAmplitudePrefix, getNoAdditionalFieldsPrefix, getWaveNumberPrefix, noAdditionalFieldsPrefixTipText, postProcessHeader, postProcessOutput, setAdditionalFields, setAmplitudePrefix, setNoAdditionalFieldsPrefix, setWaveNumberPrefix, waveNumberPrefixTipText
-
Methods inherited from class adams.data.instances.AbstractSpectrumBasedInstanceGenerator
addSampleIDTipText, checkInput, getAddSampleID, getDefaultDatabaseConnection, getLoadSampleData, getNotes, loadSampleDataTipText, notesTipText, setAddSampleID, setLoadSampleData, setNotes
-
Methods inherited from class adams.data.instances.AbstractInstanceGenerator
addDatabaseIDTipText, checkSetup, cleanUp, compareTo, destroy, equals, forCommandLine, forName, generate, getAddDatabaseID, getDatabaseConnection, getGenerators, getOffline, getOutputHeader, getTolerateHeaderChanges, initialize, interpretePosition, offlineTipText, reset, setAddDatabaseID, setDatabaseConnection, setOffline, setTolerateHeaderChanges, shallowCopy, shallowCopy, tolerateHeaderChangesTipText
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classAbstractSpectrumInstanceGeneratorWithClass
-
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.
-
checkHeader
protected void checkHeader(Spectrum data)
Checks whether the number of waves are the same.- Overrides:
checkHeader
in classAbstractSpectrumInstanceGeneratorWithClass
- Parameters:
data
- the input data
-
generateHeader
protected void generateHeader(Spectrum data)
Generates the header of the output data.- Specified by:
generateHeader
in classAbstractSpectrumInstanceGeneratorWithClass
- Parameters:
data
- the input data
-
-