|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.filters.Filter
weka.filters.unsupervised.instance.RemoveMisclassifiedRel
public class RemoveMisclassifiedRel
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.
| Field Summary | |
|---|---|
protected int |
m_classIndex
The attribute to treat as the class for purposes of cleansing. |
protected weka.classifiers.Classifier |
m_cleansingClassifier
The classifier used to do the cleansing |
protected boolean |
m_firstBatchFinished
Have we processed the first batch (i.e. |
protected boolean |
m_invertMatching
Whether to invert the match so the correctly classified instances are discarded |
protected double |
m_numericClassifyThreshold
The threshold for deciding when a numeric value is correctly classified |
protected double |
m_numericClassifyThresholdAbs
if Absolute error is less than this, then we're ok |
protected int |
m_numOfCleansingIterations
The maximum number of cleansing iterations to perform (<1 = until fully cleansed) |
protected int |
m_numOfCrossValidationFolds
The number of cross validation folds to perform (<2 = no cross validation) |
| Fields inherited from class weka.filters.Filter |
|---|
m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts |
| Constructor Summary | |
|---|---|
RemoveMisclassifiedRel()
|
|
| Method Summary | |
|---|---|
String |
absErrTipText()
Returns the tip text for this property |
boolean |
batchFinished()
Signify that this batch of input to the filter is finished. |
String |
classifierTipText()
Returns the tip text for this property |
String |
classIndexTipText()
Returns the tip text for this property |
double |
getAbsErr()
Gets the threshold for the max error when predicting a numeric class. |
weka.core.Capabilities |
getCapabilities()
Returns the Capabilities of this filter. |
weka.classifiers.Classifier |
getClassifier()
Gets the classifier used by the filter. |
protected String |
getClassifierSpec()
Gets the classifier specification string, which contains the class name of the classifier and any options to the classifier. |
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. |
String[] |
getOptions()
Gets the current settings of the filter. |
String |
getRevision()
Returns the revision string. |
double |
getThreshold()
Gets the threshold for the max error when predicting a numeric class. |
String |
globalInfo()
Returns a string describing this filter |
boolean |
input(weka.core.Instance instance)
Input an instance for filtering. |
String |
invertTipText()
Returns the tip text for this property |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(String[] argv)
Main method for testing this class. |
String |
maxIterationsTipText()
Returns the tip text for this property |
String |
numFoldsTipText()
Returns the tip text for this property |
void |
setAbsErr(double threshold)
Sets the threshold for the max error when predicting a numeric class. |
void |
setClassifier(weka.classifiers.Classifier classifier)
Sets the classifier to classify instances with. |
void |
setClassIndex(int classIndex)
Sets the attribute on which misclassifications are based. |
boolean |
setInputFormat(weka.core.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(String[] options)
Parses a given list of options. |
void |
setThreshold(double threshold)
Sets the threshold for the max error when predicting a numeric class. |
String |
thresholdTipText()
Returns the tip text for this property. |
| Methods inherited from class weka.filters.Filter |
|---|
batchFilterFile, bufferInput, copyValues, copyValues, filterFile, flushInput, getCapabilities, getInputFormat, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputFormatPeek, outputPeek, push, resetQueue, runFilter, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected weka.classifiers.Classifier m_cleansingClassifier
protected int m_classIndex
protected int m_numOfCrossValidationFolds
protected int m_numOfCleansingIterations
protected double m_numericClassifyThreshold
protected double m_numericClassifyThresholdAbs
protected boolean m_invertMatching
protected boolean m_firstBatchFinished
| Constructor Detail |
|---|
public RemoveMisclassifiedRel()
| Method Detail |
|---|
public weka.core.Capabilities getCapabilities()
getCapabilities in interface weka.core.CapabilitiesHandlergetCapabilities in class weka.filters.FilterCapabilities
public boolean setInputFormat(weka.core.Instances instanceInfo)
throws Exception
setInputFormat in class weka.filters.FilterinstanceInfo - an Instances object containing the input instance
structure (any instances contained in the object are ignored - only the
structure is required).
Exception - if the inputFormat can't be set successfully
public boolean input(weka.core.Instance instance)
throws Exception
input in class weka.filters.Filterinstance - the input instance
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.
public boolean batchFinished()
throws Exception
batchFinished in class weka.filters.FilterIllegalStateException - if no input structure has been defined
Exceptionpublic Enumeration listOptions()
listOptions in interface weka.core.OptionHandler
public void setOptions(String[] options)
throws Exception
-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 in interface weka.core.OptionHandleroptions - the list of options as an array of strings
Exception - if an option is not supportedpublic String[] getOptions()
getOptions in interface weka.core.OptionHandlerpublic String globalInfo()
public String classifierTipText()
public void setClassifier(weka.classifiers.Classifier classifier)
classifier - The classifier to be used (with its options set).public weka.classifiers.Classifier getClassifier()
protected String getClassifierSpec()
public String classIndexTipText()
public void setClassIndex(int classIndex)
classIndex - the class index.public int getClassIndex()
public String numFoldsTipText()
public void setNumFolds(int numOfFolds)
numOfFolds - the number of folds.public int getNumFolds()
public String absErrTipText()
public void setAbsErr(double threshold)
threshold - the numeric theshold.public double getAbsErr()
public String thresholdTipText()
public void setThreshold(double threshold)
threshold - the numeric theshold.public double getThreshold()
public String maxIterationsTipText()
public void setMaxIterations(int iterations)
iterations - the maximum number of iterations.public int getMaxIterations()
public String invertTipText()
public void setInvert(boolean invert)
invert - whether or not to invert selection.public boolean getInvert()
public String getRevision()
getRevision in interface weka.core.RevisionHandlergetRevision in class weka.filters.Filterpublic static void main(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 | |||||||||