Package adams.data.filter
Class OutlierDetector<T extends DataContainer>
-
- Type Parameters:
T- the type of data to pass through the filter
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<Filter>,SizeOfHandler,BatchFilter<T>,Filter<T>,TrainableBatchFilter<T>,DatabaseConnectionHandler,DatabaseConnectionProvider,DatabaseConnectionUser,Serializable,Comparable
public class OutlierDetector<T extends DataContainer> extends AbstractDatabaseConnectionFilter<T> implements TrainableBatchFilter<T>
A filter that runs an outlier detector over the data and attaches the generated detections as notes to the chromatogram.
Valid options are:
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-detector <adams.data.outlier.AbstractOutlierDetector [options]> (property: detector) The outlier detector to use (the detections generated by the algorithm get attached to the chromatogram). default: adams.data.outlier.PassThrough
-only-warning (property: onlyWarning) If enabled, the detections get added merely as warnings instead of as errors.
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.data.filter.AbstractFilter
AbstractFilter.FilterJob<T extends DataContainer>
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_OnlyWarningwhether the detection is only added as warning instead of error.protected AbstractOutlierDetectorm_OutlierDetectorthe detector algorithm.-
Fields inherited from class adams.data.filter.AbstractDatabaseConnectionFilter
m_DatabaseConnection
-
Fields inherited from class adams.data.filter.AbstractFilter
m_DontUpdateID
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description OutlierDetector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T[]batchFilter(T[] data)Batch filters the data.voiddefineOptions()Adds options to the internal list of options.StringdetectorTipText()Returns the tip text for this property.protected AbstractDatabaseConnectiongetDefaultDatabaseConnection()Returns the default database connection.AbstractOutlierDetectorgetDetector()Returns the current outlier detector.booleangetOnlyWarning()Returns whether the detections are added as error or warning.StringglobalInfo()Returns a string describing the object.booleanisTrained()Returns whether the filter has been trained already and is ready to use.StringonlyWarningTipText()Returns the tip text for this property.protected TprocessData(T data)Performs the actual filtering.voidresetFilter()Resets the filter, i.e., flags it as "not trained".voidsetDetector(AbstractOutlierDetector value)Sets the outlier detector.voidsetOnlyWarning(boolean value)Sets whether the detections are added as error or warning.voidtrainFilter(T[] data)Trains the filter with the specified data.protected voidupdateDatabaseConnection()Updates the database connection in the outlier detectors.-
Methods inherited from class adams.data.filter.AbstractDatabaseConnectionFilter
getDatabaseConnection, initialize, setDatabaseConnection
-
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, 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
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_OutlierDetector
protected AbstractOutlierDetector m_OutlierDetector
the detector algorithm.
-
m_OnlyWarning
protected boolean m_OnlyWarning
whether the detection is only added as warning instead of error.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractFilter<T extends DataContainer>
-
getDefaultDatabaseConnection
protected AbstractDatabaseConnection getDefaultDatabaseConnection()
Returns the default database connection.- Specified by:
getDefaultDatabaseConnectionin classAbstractDatabaseConnectionFilter<T extends DataContainer>- Returns:
- the default database connection
-
setDetector
public void setDetector(AbstractOutlierDetector value)
Sets the outlier detector.- Parameters:
value- the algorithm
-
getDetector
public AbstractOutlierDetector getDetector()
Returns the current outlier detector.- Returns:
- the algorithm
-
detectorTipText
public String detectorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOnlyWarning
public void setOnlyWarning(boolean value)
Sets whether the detections are added as error or warning.- Parameters:
value- if true then the detections are added as warning instead of as error
-
getOnlyWarning
public boolean getOnlyWarning()
Returns whether the detections are added as error or warning.- Returns:
- true if the detections get added as warning instead of as error
-
onlyWarningTipText
public String onlyWarningTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
updateDatabaseConnection
protected void updateDatabaseConnection()
Updates the database connection in the outlier detectors.- Overrides:
updateDatabaseConnectionin classAbstractDatabaseConnectionFilter<T extends DataContainer>
-
processData
protected T processData(T data)
Performs the actual filtering.- Specified by:
processDatain classAbstractFilter<T extends DataContainer>- Parameters:
data- the data to filter- Returns:
- the filtered data
-
resetFilter
public void resetFilter()
Resets the filter, i.e., flags it as "not trained".- Specified by:
resetFilterin interfaceTrainableBatchFilter<T extends DataContainer>- See Also:
isTrained()
-
trainFilter
public void trainFilter(T[] data)
Trains the filter with the specified data.- Specified by:
trainFilterin interfaceTrainableBatchFilter<T extends DataContainer>
-
isTrained
public boolean isTrained()
Returns whether the filter has been trained already and is ready to use.- Specified by:
isTrainedin interfaceTrainableBatchFilter<T extends DataContainer>- Returns:
- true if already trained
-
batchFilter
public T[] batchFilter(T[] data)
Batch filters the data.- Specified by:
batchFilterin interfaceBatchFilter<T extends DataContainer>- Parameters:
data- the data to filter- Returns:
- the filtered data
-
-