Class AbstractNumericOutlierDetector
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.control.removeoutliers.AbstractOutlierDetector
-
- adams.flow.control.removeoutliers.AbstractNumericOutlierDetector
-
- All Implemented Interfaces:
Destroyable
,ErrorProvider
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
IQR
,MeanAbsoluteError
,StdDev
public abstract class AbstractNumericOutlierDetector extends AbstractOutlierDetector
Ancestor for numeric outlier detection.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class adams.flow.control.removeoutliers.AbstractOutlierDetector
m_LastError
-
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 AbstractNumericOutlierDetector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
check(SpreadSheet sheet, SpreadSheetColumnIndex actual, SpreadSheetColumnIndex predicted)
Check method before detection.protected double[]
diff(SpreadSheet sheet, SpreadSheetColumnIndex actual, SpreadSheetColumnIndex predicted, boolean useRelative)
Computes the difference between the two columns.protected double[]
diff(Double[] actual, Double[] predicted, boolean useRelative)
Computes the difference between the two columns.protected Double[]
extractColumn(SpreadSheet sheet, SpreadSheetColumnIndex col)
Extracts the double values from the specified column.-
Methods inherited from class adams.flow.control.removeoutliers.AbstractOutlierDetector
detect, doDetect, getLastError, getQuickInfo, hasLastError
-
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
-
-
-
-
Method Detail
-
check
public String check(SpreadSheet sheet, SpreadSheetColumnIndex actual, SpreadSheetColumnIndex predicted)
Check method before detection.- Overrides:
check
in classAbstractOutlierDetector
- 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
-
extractColumn
protected Double[] extractColumn(SpreadSheet sheet, SpreadSheetColumnIndex col)
Extracts the double values from the specified column.- Parameters:
sheet
- the sheet to get the data fromcol
- the column- Returns:
- the data, null entries for non-numeric or missing values
-
diff
protected double[] diff(Double[] actual, Double[] predicted, boolean useRelative)
Computes the difference between the two columns.- Parameters:
actual
- the column with the actual valuespredicted
- the column with the predicted valuesuseRelative
- whether to divide the difference by the actual value (NaN if 0)- Returns:
- the difference, uses NaN if either column has non-numeric or missing value
-
diff
protected double[] diff(SpreadSheet sheet, SpreadSheetColumnIndex actual, SpreadSheetColumnIndex predicted, boolean useRelative)
Computes the difference between the two columns.- Parameters:
sheet
- the sheet to get the data fromactual
- the column with the actual valuespredicted
- the column with the predicted valuesuseRelative
- whether to divide the difference by the actual value (NaN if 0)- Returns:
- the difference, uses NaN if either column has non-numeric or missing value
-
-