Package adams.data.spectrumfilter
Class PCA
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.filter.AbstractFilter<T>
-
- adams.data.filter.AbstractBatchFilter<Spectrum>
-
- adams.data.spectrumfilter.PCA
-
- 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.filter.Filter>
,adams.core.SizeOfHandler
,adams.data.filter.BatchFilter<Spectrum>
,adams.data.filter.Filter<Spectrum>
,Serializable
,Comparable
public class PCA extends adams.data.filter.AbstractBatchFilter<Spectrum>
Turns the spectra internally into instances and transforms them using principal component analysis (PCA).
The generated output is then converted back into spectra.
Only works as batch filter, not in single spectrum mode.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-no-id-update <boolean> (property: dontUpdateID) If enabled, suppresses updating the ID of adams.data.id.IDHandler data containers. default: false
-generator <knir.data.instances.AbstractInstanceGenerator> (property: generator) The instance generator to use for turning the spectra into Weka Instance objects. default: knir.data.instances.SimpleInstanceGenerator
-variance <double> (property: variance) The variance to cover. default: 0.95 minimum: 0.0
-max-attributes <int> (property: maxAttributes) The maximum attributes. default: -1 minimum: -1
-max-attribute-names <int> (property: maxAttributeNames) The maximum number of attribute names. default: 5 minimum: -1
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.data.instances.AbstractInstanceGenerator
m_Generator
the instance generator to use.protected int
m_MaxAttributeNames
the maximum number of attribute names.protected int
m_MaxAttributes
the maximum number of attributes.protected double
m_Variance
the variance to cover.
-
Constructor Summary
Constructors Constructor Description PCA()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String
generatorTipText()
Tip text for this property.adams.data.instances.AbstractInstanceGenerator
getGenerator()
Returns the instance generator in use.int
getMaxAttributeNames()
Returns the maximum number of attribute names.int
getMaxAttributes()
Returns the maximum attributes.double
getVariance()
Returns the variance.String
globalInfo()
Returns a string describing the object.String
maxAttributeNamesTipText()
Returns the tip text for this property.String
maxAttributesTipText()
Returns the tip text for this property.protected Spectrum[]
processBatchData(Spectrum[] data)
Performs the actual batch filtering.protected Spectrum
processData(Spectrum data)
Does nothing.void
setGenerator(adams.data.instances.AbstractInstanceGenerator value)
Sets the instance generator to use.void
setMaxAttributeNames(int value)
Sets the maximum number of attribute names.void
setMaxAttributes(int value)
Sets the maximum attributes.void
setVariance(double value)
Sets the variance.String
varianceTipText()
Returns the tip text for this property.-
Methods inherited from class adams.data.filter.AbstractFilter
checkData, cleanUp, compareTo, destroy, dontUpdateIDTipText, equals, filter, forCommandLine, getDontUpdateID, reset, setDontUpdateID, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.data.filter.Filter
cleanUp, compareTo, destroy, dontUpdateIDTipText, equals, filter, getDontUpdateID, reset, setDontUpdateID, shallowCopy, shallowCopy
-
-
-
-
Field Detail
-
m_Generator
protected adams.data.instances.AbstractInstanceGenerator m_Generator
the instance generator to use.
-
m_Variance
protected double m_Variance
the variance to cover.
-
m_MaxAttributes
protected int m_MaxAttributes
the maximum number of attributes.
-
m_MaxAttributeNames
protected int m_MaxAttributeNames
the maximum number of attribute names.
-
-
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 classadams.data.filter.AbstractFilter<Spectrum>
-
setGenerator
public void setGenerator(adams.data.instances.AbstractInstanceGenerator value)
Sets the instance generator to use.- Parameters:
value
- the generator
-
getGenerator
public adams.data.instances.AbstractInstanceGenerator getGenerator()
Returns the instance generator in use.- Returns:
- the generator
-
generatorTipText
public String generatorTipText()
Tip text for this property.- Returns:
- description for displaying in the GUI
-
setVariance
public void setVariance(double value)
Sets the variance.- Parameters:
value
- the variance
-
getVariance
public double getVariance()
Returns the variance.- Returns:
- the variance
-
varianceTipText
public String varianceTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMaxAttributes
public void setMaxAttributes(int value)
Sets the maximum attributes.- Parameters:
value
- the maximum
-
getMaxAttributes
public int getMaxAttributes()
Returns the maximum attributes.- Returns:
- the maximum
-
maxAttributesTipText
public String maxAttributesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMaxAttributeNames
public void setMaxAttributeNames(int value)
Sets the maximum number of attribute names.- Parameters:
value
- the maximum
-
getMaxAttributeNames
public int getMaxAttributeNames()
Returns the maximum number of attribute names.- Returns:
- the maximum
-
maxAttributeNamesTipText
public String maxAttributeNamesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
processBatchData
protected Spectrum[] processBatchData(Spectrum[] data)
Performs the actual batch filtering.- Specified by:
processBatchData
in classadams.data.filter.AbstractBatchFilter<Spectrum>
- Parameters:
data
- the data to filter- Returns:
- the filtered data
-
-