Class AbstractOutlierDetector
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.control.removeoutliers.AbstractOutlierDetector
-
- All Implemented Interfaces:
Destroyable
,ErrorProvider
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
AbstractNumericOutlierDetector
,MultiOutlierDetector
,Null
public abstract class AbstractOutlierDetector extends AbstractOptionHandler implements QuickInfoSupporter, ErrorProvider
Ancestor for outlier detectors of actual vs predicted.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_LastError
the last error that occurred.-
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 AbstractOutlierDetector()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
check(SpreadSheet sheet, SpreadSheetColumnIndex actual, SpreadSheetColumnIndex predicted)
Check method before detection.Set<Integer>
detect(SpreadSheet sheet, SpreadSheetColumnIndex actual, SpreadSheetColumnIndex predicted)
For detecting outliers.protected abstract Set<Integer>
doDetect(SpreadSheet sheet, SpreadSheetColumnIndex actual, SpreadSheetColumnIndex predicted)
Performs the actual detection of the outliers.String
getLastError()
Returns any error that occurred during the last detection.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.boolean
hasLastError()
Returns whether an occurred during the last detection.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_LastError
protected String m_LastError
the last error that occurred.
-
-
Method Detail
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.
Default implementation returns null.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Returns:
- null if no info available, otherwise short string
-
hasLastError
public boolean hasLastError()
Returns whether an occurred during the last detection.- Specified by:
hasLastError
in interfaceErrorProvider
- Returns:
- true if an error occurred
-
getLastError
public String getLastError()
Returns any error that occurred during the last detection.- Specified by:
getLastError
in interfaceErrorProvider
- Returns:
- the error, null if none occurred
-
check
public String check(SpreadSheet sheet, SpreadSheetColumnIndex actual, SpreadSheetColumnIndex predicted)
Check method before detection.- Parameters:
sheet
- the spreadsheet to analyzeactual
- the column with the actual valuespredicted
- the column with the predicted values- Returns:
- null if check passed, otherwise error message
-
doDetect
protected abstract Set<Integer> doDetect(SpreadSheet sheet, SpreadSheetColumnIndex actual, SpreadSheetColumnIndex predicted)
Performs the actual detection of the outliers.- Parameters:
sheet
- the spreadsheet to analyzeactual
- the column with the actual valuespredicted
- the column with the predicted values- Returns:
- the row indices of the outliers
-
detect
public Set<Integer> detect(SpreadSheet sheet, SpreadSheetColumnIndex actual, SpreadSheetColumnIndex predicted)
For detecting outliers.- Parameters:
sheet
- the spreadsheet to analyzeactual
- the column with the actual valuespredicted
- the column with the predicted values- Returns:
- the row indices of the outliers, null in case of an error
-
-