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 doublem_AbsDiffabsolute difference.protected weka.classifiers.Classifierm_ClassifierWEKA classifier used for modeling.protected weka.filters.unsupervised.instance.RemoveMisclassifiedRelm_Filterthe filter.protected weka.core.Instancesm_FilteredInitDatathe filtered data generated when initializing the postprocessor.protected intm_Foldsnumber of fold for the cross validation.protected intm_Iterationsnumber of cleaning iterations to run.protected doublem_RelDiffthe 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 StringabsdiffTipText()Returns the tip text for this property.StringclassifierTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.StringfoldsTipText()Returns the tip text for this property.doublegetAbsdiff()Returns the absolute difference.weka.classifiers.ClassifiergetClassifier()Returns the classifier.intgetFolds()Returns the folds.intgetIterations()Returns the iterations.doublegetReldiff()Returns the relative difference.StringglobalInfo()Returns a string describing the object.voidinitSerializationSetup()Regenerates all the objects that are necessary for serialization.StringiterationsTipText()Returns the tip text for this property.protected StringperformCheck(weka.core.Instance data)Performs the actual check.protected weka.core.InstancesperformClean(weka.core.Instances instances)Clean Instances.StringreldiffTipText()Returns the tip text for this property.protected voidreset()Resets the scheme.Object[]retrieveSerializationSetup()Returns the member variables to serialize to a file.voidsetAbsdiff(double value)Sets the absolute difference.voidsetClassifier(weka.classifiers.Classifier value)Sets the classifier.voidsetFolds(int value)Sets the folds.voidsetIterations(int value)Sets the iterations.voidsetReldiff(double value)Sets the relative difference.voidsetSerializationSetup(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:
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 classAbstractSerializableCleaner
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin 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:
performCheckin 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:
performCleanin classAbstractCleaner- Parameters:
instances- Instances- Returns:
- null if ok, otherwise error message
-
-