类 RemoveMisclassified
java.lang.Object
weka.filters.Filter
weka.filters.unsupervised.instance.RemoveMisclassified
A filter that removes instances which are incorrectly classified. Useful for removing outliers.
Valid options are:
-W <classifier specification> Full class name of classifier to use, followed by scheme options. eg: "weka.classifiers.bayes.NaiveBayes -D" (default: weka.classifiers.rules.ZeroR)
-C <class index> Attribute on which misclassifications are based. If < 0 will use any current set class or default to the last attribute.
-F <number of folds> The number of folds to use for cross-validation cleansing. (<2 = no cross-validation - default).
-T <threshold> Threshold for the max error when predicting numeric class. (Value should be >= 0, default = 0.1).
-I The maximum number of cleansing iterations to perform. (<1 = until fully cleansed - default)
-V Invert the match so that correctly classified instances are discarded.
- 版本:
- $Revision: 5548 $
- 作者:
- Richard Kirkby (rkirkby@cs.waikato.ac.nz), Malcolm Ware (mfw4@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean
Signify that this batch of input to the filter is finished.Returns the tip text for this propertyReturns the tip text for this propertyReturns the Capabilities of this filter.Gets the classifier used by the filter.int
Gets the attribute on which misclassifications are based.boolean
Get whether selection is inverted.int
Gets the maximum number of cleansing iterations performedint
Gets the number of cross-validation folds used by the filter.String[]
Gets the current settings of the filter.Returns the revision string.double
Gets the threshold for the max error when predicting a numeric class.Returns a string describing this filterboolean
Input an instance for filtering.Returns the tip text for this propertyReturns an enumeration describing the available options.static void
Main method for testing this class.Returns the tip text for this propertyReturns the tip text for this propertyvoid
setClassifier
(Classifier classifier) Sets the classifier to classify instances with.void
setClassIndex
(int classIndex) Sets the attribute on which misclassifications are based.boolean
setInputFormat
(Instances instanceInfo) Sets the format of the input instances.void
setInvert
(boolean invert) Set whether selection is inverted.void
setMaxIterations
(int iterations) Sets the maximum number of cleansing iterations to perform - < 1 means go until fully cleansedvoid
setNumFolds
(int numOfFolds) Sets the number of cross-validation folds to use - < 2 means no cross-validation.void
setOptions
(String[] options) Parses a given list of options.void
setThreshold
(double threshold) Sets the threshold for the max error when predicting a numeric class.Returns the tip text for this property从类继承的方法 weka.filters.Filter
batchFilterFile, filterFile, getCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, numPendingOutput, output, outputPeek, toString, useFilter, wekaStaticWrapper
-
构造器详细资料
-
RemoveMisclassified
public RemoveMisclassified()
-
-
方法详细资料
-
getCapabilities
Returns the Capabilities of this filter.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 覆盖:
getCapabilities
在类中Filter
- 返回:
- the capabilities of this object
- 另请参阅:
-
setInputFormat
Sets the format of the input instances.- 覆盖:
setInputFormat
在类中Filter
- 参数:
instanceInfo
- an Instances object containing the input instance structure (any instances contained in the object are ignored - only the structure is required).- 返回:
- true if the outputFormat may be collected immediately
- 抛出:
Exception
- if the inputFormat can't be set successfully
-
input
Input an instance for filtering.- 覆盖:
input
在类中Filter
- 参数:
instance
- the input instance- 返回:
- true if the filtered instance may now be collected with output().
- 抛出:
NullPointerException
- if the input format has not been defined.Exception
- if the input instance was not of the correct format or if there was a problem with the filtering.
-
batchFinished
Signify that this batch of input to the filter is finished.- 覆盖:
batchFinished
在类中Filter
- 返回:
- true if there are instances pending output
- 抛出:
IllegalStateException
- if no input structure has been definedNullPointerException
- if no input structure has been defined,Exception
- if there was a problem finishing the batch.
-
listOptions
Returns an enumeration describing the available options.- 指定者:
listOptions
在接口中OptionHandler
- 返回:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-W <classifier specification> Full class name of classifier to use, followed by scheme options. eg: "weka.classifiers.bayes.NaiveBayes -D" (default: weka.classifiers.rules.ZeroR)
-C <class index> Attribute on which misclassifications are based. If < 0 will use any current set class or default to the last attribute.
-F <number of folds> The number of folds to use for cross-validation cleansing. (<2 = no cross-validation - default).
-T <threshold> Threshold for the max error when predicting numeric class. (Value should be >= 0, default = 0.1).
-I The maximum number of cleansing iterations to perform. (<1 = until fully cleansed - default)
-V Invert the match so that correctly classified instances are discarded.
- 指定者:
setOptions
在接口中OptionHandler
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of the filter.- 指定者:
getOptions
在接口中OptionHandler
- 返回:
- an array of strings suitable for passing to setOptions
-
globalInfo
Returns a string describing this filter- 返回:
- a description of the filter suitable for displaying in the explorer/experimenter gui
-
classifierTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setClassifier
Sets the classifier to classify instances with.- 参数:
classifier
- The classifier to be used (with its options set).
-
getClassifier
Gets the classifier used by the filter.- 返回:
- The classifier to be used.
-
classIndexTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setClassIndex
public void setClassIndex(int classIndex) Sets the attribute on which misclassifications are based. If < 0 will use any current set class or default to the last attribute.- 参数:
classIndex
- the class index.
-
getClassIndex
public int getClassIndex()Gets the attribute on which misclassifications are based.- 返回:
- the class index.
-
numFoldsTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setNumFolds
public void setNumFolds(int numOfFolds) Sets the number of cross-validation folds to use - < 2 means no cross-validation.- 参数:
numOfFolds
- the number of folds.
-
getNumFolds
public int getNumFolds()Gets the number of cross-validation folds used by the filter.- 返回:
- the number of folds.
-
thresholdTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setThreshold
public void setThreshold(double threshold) Sets the threshold for the max error when predicting a numeric class. The value should be >= 0.- 参数:
threshold
- the numeric theshold.
-
getThreshold
public double getThreshold()Gets the threshold for the max error when predicting a numeric class.- 返回:
- the numeric threshold.
-
maxIterationsTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setMaxIterations
public void setMaxIterations(int iterations) Sets the maximum number of cleansing iterations to perform - < 1 means go until fully cleansed- 参数:
iterations
- the maximum number of iterations.
-
getMaxIterations
public int getMaxIterations()Gets the maximum number of cleansing iterations performed- 返回:
- the maximum number of iterations.
-
invertTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setInvert
public void setInvert(boolean invert) Set whether selection is inverted.- 参数:
invert
- whether or not to invert selection.
-
getInvert
public boolean getInvert()Get whether selection is inverted.- 返回:
- whether or not selection is inverted.
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中Filter
- 返回:
- the revision
-
main
Main method for testing this class.- 参数:
argv
- should contain arguments to the filter: use -h for help
-