Package adams.data.cleaner.instance
Class RemoveMisclassifiedCleaner
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.cleaner.instance.AbstractCleaner
-
- adams.data.cleaner.instance.AbstractSerializableCleaner
-
- adams.data.cleaner.instance.RemoveMisclassifiedCleaner
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SerializableObject
,adams.core.ShallowCopySupporter<AbstractCleaner>
,adams.core.SizeOfHandler
,adams.flow.core.FlowContextHandler
,Serializable
,Comparable
public class RemoveMisclassifiedCleaner extends AbstractSerializableCleaner
Removes instances that are misclassified by the given relative difference, unless they are within the absolute difference.
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
-serialization-file <adams.core.io.PlaceholderFile> (property: serializationFile) The file to serialize the generated internal model to. default: ${CWD}
-override-serialized-file (property: overrideSerializedFile) If set to true, then any serialized file will be ignored and the setup for serialization will be regenerated.
-reldiff <double> (property: reldiff) Maximum relative difference between target and prediction; predictions beyond this difference will be removed; to turn off, use 0. default: 0.25
-absdiff <double> (property: absdiff) If the diffence between target and prediction is <= this value, then the instance will not be removed regardless of relative difference. default: 1.0
-iterations <int> (property: iterations) Number of passes for the misclassification process. default: 1
-folds <int> (property: folds) Number of folds for the cross-validation. default: 3
-classifier <weka.classifiers.Classifier> (property: classifier) Classifier to use for generating predictions. default: weka.classifiers.meta.SpectrumClassifier -W weka.classifiers.functions.PLSClassifier -- -filter \"weka.filters.supervised.attribute.PLSFilter -C 20 -M -A PLS1 -P center\"
- Author:
- dale (dale at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double
m_AbsDiff
absolute difference.protected weka.classifiers.Classifier
m_Classifier
WEKA classifier used for modeling.protected weka.filters.unsupervised.instance.RemoveMisclassifiedRel
m_Filter
the filter.protected weka.core.Instances
m_FilteredInitData
the filtered data generated when initializing the postprocessor.protected int
m_Folds
number of fold for the cross validation.protected int
m_Iterations
number of cleaning iterations to run.protected double
m_RelDiff
the relative difference.-
Fields inherited from class adams.data.cleaner.instance.AbstractSerializableCleaner
m_InitData, m_OverrideSerializationFile, m_SerializableObjectHelper, m_SerializationFile
-
Fields inherited from class adams.data.cleaner.instance.AbstractCleaner
m_ActualPreFilter, m_CleanInstancesError, m_FlowContext, m_PreFilter
-
-
Constructor Summary
Constructors Constructor Description RemoveMisclassifiedCleaner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
absdiffTipText()
Returns the tip text for this property.String
classifierTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.String
foldsTipText()
Returns the tip text for this property.double
getAbsdiff()
Returns the absolute difference.weka.classifiers.Classifier
getClassifier()
Returns the classifier.int
getFolds()
Returns the folds.int
getIterations()
Returns the iterations.double
getReldiff()
Returns the relative difference.String
globalInfo()
Returns a string describing the object.void
initSerializationSetup()
Regenerates all the objects that are necessary for serialization.String
iterationsTipText()
Returns the tip text for this property.protected String
performCheck(weka.core.Instance data)
Performs the actual check.protected weka.core.Instances
performClean(weka.core.Instances instances)
Clean Instances.String
reldiffTipText()
Returns the tip text for this property.protected void
reset()
Resets the scheme.Object[]
retrieveSerializationSetup()
Returns the member variables to serialize to a file.void
setAbsdiff(double value)
Sets the absolute difference.void
setClassifier(weka.classifiers.Classifier value)
Sets the classifier.void
setFolds(int value)
Sets the folds.void
setIterations(int value)
Sets the iterations.void
setReldiff(double value)
Sets the relative difference.void
setSerializationSetup(Object[] value)
Updates the member variables with the provided objects obtained from deserialization.-
Methods inherited from class adams.data.cleaner.instance.AbstractSerializableCleaner
destroy, getOverrideSerializedFile, getSerializationFile, initialize, isSetupLoadedOrGenerated, overrideSerializedFileTipText, preCheck, preCheck, serializationFileTipText, setOverrideSerializedFile, setSerializationFile, setSetupLoadedOrGenerated
-
Methods inherited from class adams.data.cleaner.instance.AbstractCleaner
check, clean, compareTo, equals, forCommandLine, forName, getCleaners, getCleanInstancesError, getFlowContext, getPreFilter, hasCleanInstancesError, preFilter, preFilter, preFilterTipText, setFlowContext, setPreFilter, 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
-
-
-
-
Field Detail
-
m_RelDiff
protected double m_RelDiff
the relative difference.
-
m_AbsDiff
protected double m_AbsDiff
absolute difference.
-
m_Folds
protected int m_Folds
number of fold for the cross validation.
-
m_Iterations
protected int m_Iterations
number of cleaning iterations to run.
-
m_Classifier
protected weka.classifiers.Classifier m_Classifier
WEKA classifier used for modeling.
-
m_Filter
protected weka.filters.unsupervised.instance.RemoveMisclassifiedRel m_Filter
the filter.
-
m_FilteredInitData
protected weka.core.Instances m_FilteredInitData
the filtered data generated when initializing the postprocessor.
-
-
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 classAbstractSerializableCleaner
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractSerializableCleaner
-
setReldiff
public void setReldiff(double value)
Sets the relative difference.- Parameters:
value
- relative difference
-
getReldiff
public double getReldiff()
Returns the relative difference.- Returns:
- the relative difference
-
reldiffTipText
public String reldiffTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAbsdiff
public void setAbsdiff(double value)
Sets the absolute difference.- Parameters:
value
- absolute difference
-
getAbsdiff
public double getAbsdiff()
Returns the absolute difference.- Returns:
- the absolute difference
-
absdiffTipText
public String absdiffTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setIterations
public void setIterations(int value)
Sets the iterations.- Parameters:
value
- iterations
-
getIterations
public int getIterations()
Returns the iterations.- Returns:
- the iterations
-
iterationsTipText
public String iterationsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFolds
public void setFolds(int value)
Sets the folds.- Parameters:
value
- folds
-
getFolds
public int getFolds()
Returns the folds.- Returns:
- the folds
-
foldsTipText
public String foldsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setClassifier
public void setClassifier(weka.classifiers.Classifier value)
Sets the classifier.- Parameters:
value
- classifier
-
getClassifier
public weka.classifiers.Classifier getClassifier()
Returns the classifier.- Returns:
- the classifier
-
classifierTipText
public String classifierTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
performCheck
protected String performCheck(weka.core.Instance data)
Performs the actual check.- Specified by:
performCheck
in classAbstractCleaner
- Parameters:
data
- the Instance to check- Returns:
- null if ok, otherwise error message
-
initSerializationSetup
public void initSerializationSetup()
Regenerates all the objects that are necessary for serialization.
-
retrieveSerializationSetup
public Object[] retrieveSerializationSetup()
Returns the member variables to serialize to a file.- Returns:
- the objects to serialize
-
setSerializationSetup
public void setSerializationSetup(Object[] value)
Updates the member variables with the provided objects obtained from deserialization.- Parameters:
value
- the deserialized objects
-
performClean
protected weka.core.Instances performClean(weka.core.Instances instances)
Clean Instances.- Specified by:
performClean
in classAbstractCleaner
- Parameters:
instances
- Instances- Returns:
- null if ok, otherwise error message
-
-