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.AbstractInstanceGeneratorm_Generatorthe instance generator to use.protected intm_MaxAttributeNamesthe maximum number of attribute names.protected intm_MaxAttributesthe maximum number of attributes.protected doublem_Variancethe variance to cover.
-
Constructor Summary
Constructors Constructor Description PCA()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.StringgeneratorTipText()Tip text for this property.adams.data.instances.AbstractInstanceGeneratorgetGenerator()Returns the instance generator in use.intgetMaxAttributeNames()Returns the maximum number of attribute names.intgetMaxAttributes()Returns the maximum attributes.doublegetVariance()Returns the variance.StringglobalInfo()Returns a string describing the object.StringmaxAttributeNamesTipText()Returns the tip text for this property.StringmaxAttributesTipText()Returns the tip text for this property.protected Spectrum[]processBatchData(Spectrum[] data)Performs the actual batch filtering.protected SpectrumprocessData(Spectrum data)Does nothing.voidsetGenerator(adams.data.instances.AbstractInstanceGenerator value)Sets the instance generator to use.voidsetMaxAttributeNames(int value)Sets the maximum number of attribute names.voidsetMaxAttributes(int value)Sets the maximum attributes.voidsetVariance(double value)Sets the variance.StringvarianceTipText()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:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin 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:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin 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:
processBatchDatain classadams.data.filter.AbstractBatchFilter<Spectrum>- Parameters:
data- the data to filter- Returns:
- the filtered data
-
-