|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 filter-specific options are:
-W classifier string
Full class name of classifier to use, followed by scheme options. (required)
-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 max iterations
The maximum number of cleansing iterations to perform.
(<1 = until fully cleansed - default)
-V
Invert the match so that correctly classified instances are discarded.
Constructor Summary | |
RemoveMisclassified()
|
Method Summary | |
boolean |
batchFinished()
Signify that this batch of input to the filter is finished. |
java.lang.String |
classifierTipText()
Returns the tip text for this property |
java.lang.String |
classIndexTipText()
Returns the tip text for this property |
Classifier |
getClassifier()
Gets the classifier used by the filter. |
int |
getClassIndex()
Gets the attribute on which misclassifications are based. |
boolean |
getInvert()
Get whether selection is inverted. |
int |
getMaxIterations()
Gets the maximum number of cleansing iterations performed |
int |
getNumFolds()
Gets the number of cross-validation folds used by the filter. |
java.lang.String[] |
getOptions()
Gets the current settings of the filter. |
double |
getThreshold()
Gets the threshold for the max error when predicting a numeric class. |
java.lang.String |
globalInfo()
Returns a string describing this filter |
boolean |
input(Instance instance)
Input an instance for filtering. |
java.lang.String |
invertTipText()
Returns the tip text for this property |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
java.lang.String |
maxIterationsTipText()
Returns the tip text for this property |
java.lang.String |
numFoldsTipText()
Returns the tip text for this property |
void |
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 cleansed |
void |
setNumFolds(int numOfFolds)
Sets the number of cross-validation folds to use - < 2 means no cross-validation. |
void |
setOptions(java.lang.String[] options)
Parses the options for this object. |
void |
setThreshold(double threshold)
Sets the threshold for the max error when predicting a numeric class. |
java.lang.String |
thresholdTipText()
Returns the tip text for this property |
Methods inherited from class weka.filters.Filter |
batchFilterFile, filterFile, getOutputFormat, inputFormat, isOutputFormatDefined, numPendingOutput, output, outputFormat, outputPeek, useFilter |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RemoveMisclassified()
Method Detail |
public boolean setInputFormat(Instances instanceInfo) throws java.lang.Exception
setInputFormat
in class Filter
instanceInfo
- an Instances object containing the input instance
structure (any instances contained in the object are ignored - only the
structure is required).
java.lang.Exception
- if the inputFormat can't be set successfullypublic boolean input(Instance instance) throws java.lang.Exception
input
in class Filter
instance
- the input instance
java.lang.NullPointerException
- if the input format has not been
defined.
java.lang.Exception
- if the input instance was not of the correct
format or if there was a problem with the filtering.public boolean batchFinished() throws java.lang.Exception
batchFinished
in class Filter
java.lang.IllegalStateException
- if no input structure has been defined
java.lang.Exception
- if there was a problem finishing the batch.public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-W classifier string
Full class name of classifier to use, followed by scheme options. (required)
-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 max iterations
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
in interface OptionHandler
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public java.lang.String globalInfo()
public java.lang.String classifierTipText()
public void setClassifier(Classifier classifier)
classifier
- The classifier to be used (with its options set).public Classifier getClassifier()
public java.lang.String classIndexTipText()
public void setClassIndex(int classIndex)
classIndex
- the class index.public int getClassIndex()
public java.lang.String numFoldsTipText()
public void setNumFolds(int numOfFolds)
numOfFolds
- the number of folds.public int getNumFolds()
public java.lang.String thresholdTipText()
public void setThreshold(double threshold)
threshold
- the numeric theshold.public double getThreshold()
public java.lang.String maxIterationsTipText()
public void setMaxIterations(int iterations)
iterations
- the maximum number of iterations.public int getMaxIterations()
public java.lang.String invertTipText()
public void setInvert(boolean invert)
invert
- whether or not to invert selection.public boolean getInvert()
public static void main(java.lang.String[] argv)
argv
- should contain arguments to the filter: use -h for help
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London