|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.AbstractClassifier
weka.classifiers.SingleClassifierEnhancer
weka.classifiers.meta.FilteredClassifier
weka.classifiers.meta.FilteredClassifierExt
public class FilteredClassifierExt
Class for running an arbitrary classifier on data that has been passed through an arbitrary filter. Like the classifier, the structure of the filter is based exclusively on the training data and test instances will be processed by the filter without changing their structure.
In addition to the default FilteredClassifier, one can specify a range of attributes that are to be removed before applying the actual filter. Useful to remove ID attributes, without having to nest another FilteredClassifier.
The meta-classifier also 'pretends' to be able to:
- handle weighted instances
- produce confidence intervals
This will only lead to reasonable results, of course, if the base classifier supports this functionality.
-R <att list> The range of attributes to remove. 'first' and 'last' are accepted as well. (default: none)
-F <filter specification> Full class name of filter to use, followed by filter options. eg: "weka.filters.unsupervised.attribute.Remove -V -R 1,2"
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.trees.J48)
Options specific to classifier weka.classifiers.trees.J48:
-U Use unpruned tree.
-O Do not collapse tree.
-C <pruning confidence> Set confidence threshold for pruning. (default 0.25)
-M <minimum number of instances> Set minimum number of instances per leaf. (default 2)
-R Use reduced error pruning.
-N <number of folds> Set number of folds for reduced error pruning. One fold is used as pruning set. (default 3)
-B Use binary splits only.
-S Don't perform subtree raising.
-L Do not clean up after the tree has been built.
-A Laplace smoothing for predicted probabilities.
-J Do not use MDL correction for info gain on numeric attributes.
-Q <seed> Seed for random data shuffling (default 1).
| Field Summary | |
|---|---|
protected weka.filters.unsupervised.attribute.Remove |
m_Remove
The additional remove filter. |
| Fields inherited from class weka.classifiers.meta.FilteredClassifier |
|---|
m_Filter, m_FilteredInstances |
| Fields inherited from class weka.classifiers.SingleClassifierEnhancer |
|---|
m_Classifier |
| Fields inherited from class weka.classifiers.AbstractClassifier |
|---|
m_Debug |
| Fields inherited from interface weka.core.Drawable |
|---|
BayesNet, Newick, NOT_DRAWABLE, TREE |
| Constructor Summary | |
|---|---|
FilteredClassifierExt()
|
|
| Method Summary | |
|---|---|
void |
buildClassifier(weka.core.Instances data)
Build the classifier on the filtered data. |
double[] |
distributionForInstance(weka.core.Instance instance)
Classifies a given instance after filtering. |
protected weka.core.Instance |
filter(weka.filters.Filter filter,
weka.core.Instance instance)
Filters the Instance through the specified filter. |
protected weka.core.Instance |
filter(weka.core.Instance instance)
Filters the Instance through the remove filter if necessary. |
protected weka.core.Instances |
filter(weka.core.Instances data)
Filters the dataset through the remove filter if necessary. |
weka.core.Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
String[] |
getOptions()
Gets the current settings of the Classifier. |
String |
getRemoveAttributeIndices()
Returns the attributes indices that are removed before applying the actual filter. |
String |
getRevision()
Returns the revision string. |
String |
globalInfo()
Returns a string describing this classifier. |
protected boolean |
isRemoveUsed()
Returns whether the Remove filter is used at all. |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(String[] args)
Main method for running this classifier. |
double[][] |
predictIntervals(weka.core.Instance instance,
double confidenceLevel)
Returns an N * 2 array, where N is the number of prediction intervals. |
String |
removeAttributeIndicesTipText()
Returns the tip text for this property. |
void |
setOptions(String[] options)
Parses a given list of options. |
void |
setRemoveAttributeIndices(String value)
Sets the attribute indices to remove before applying the actual filter. |
| Methods inherited from class weka.classifiers.meta.FilteredClassifier |
|---|
defaultClassifierString, filterTipText, getFilter, getFilterSpec, graph, graphType, setFilter, toString |
| Methods inherited from class weka.classifiers.SingleClassifierEnhancer |
|---|
classifierTipText, getClassifier, getClassifierSpec, setClassifier |
| Methods inherited from class weka.classifiers.AbstractClassifier |
|---|
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebug |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected weka.filters.unsupervised.attribute.Remove m_Remove
| Constructor Detail |
|---|
public FilteredClassifierExt()
| Method Detail |
|---|
public String globalInfo()
globalInfo in class weka.classifiers.meta.FilteredClassifierpublic Enumeration listOptions()
listOptions in interface weka.core.OptionHandlerlistOptions in class weka.classifiers.meta.FilteredClassifier
public void setOptions(String[] options)
throws Exception
-R <att list> The range of attributes to remove. 'first' and 'last' are accepted as well. (default: none)
-F <filter specification> Full class name of filter to use, followed by filter options. eg: "weka.filters.unsupervised.attribute.Remove -V -R 1,2"
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.trees.J48)
Options specific to classifier weka.classifiers.trees.J48:
-U Use unpruned tree.
-O Do not collapse tree.
-C <pruning confidence> Set confidence threshold for pruning. (default 0.25)
-M <minimum number of instances> Set minimum number of instances per leaf. (default 2)
-R Use reduced error pruning.
-N <number of folds> Set number of folds for reduced error pruning. One fold is used as pruning set. (default 3)
-B Use binary splits only.
-S Don't perform subtree raising.
-L Do not clean up after the tree has been built.
-A Laplace smoothing for predicted probabilities.
-J Do not use MDL correction for info gain on numeric attributes.
-Q <seed> Seed for random data shuffling (default 1).
setOptions in interface weka.core.OptionHandlersetOptions in class weka.classifiers.meta.FilteredClassifieroptions - the list of options as an array of strings
Exception - if an option is not supportedpublic String[] getOptions()
getOptions in interface weka.core.OptionHandlergetOptions in class weka.classifiers.meta.FilteredClassifierpublic String removeAttributeIndicesTipText()
public void setRemoveAttributeIndices(String value)
value - the attribute indices (1-based)public String getRemoveAttributeIndices()
protected boolean isRemoveUsed()
public weka.core.Capabilities getCapabilities()
getCapabilities in interface weka.classifiers.ClassifiergetCapabilities in interface weka.core.CapabilitiesHandlergetCapabilities in class weka.classifiers.meta.FilteredClassifier
protected weka.core.Instances filter(weka.core.Instances data)
throws Exception
data - the data to filter
Exception - if filtering failsm_Remove
public void buildClassifier(weka.core.Instances data)
throws Exception
buildClassifier in interface weka.classifiers.ClassifierbuildClassifier in class weka.classifiers.meta.FilteredClassifierdata - the training data
Exception - if the classifier could not be built successfully
protected weka.core.Instance filter(weka.filters.Filter filter,
weka.core.Instance instance)
throws Exception
filter - the filter to useinstance - the instance to filter
Exception - if filtering fails
protected weka.core.Instance filter(weka.core.Instance instance)
throws Exception
instance - the instance to filter
Exception - if filtering failsm_Remove
public double[] distributionForInstance(weka.core.Instance instance)
throws Exception
distributionForInstance in interface weka.classifiers.ClassifierdistributionForInstance in class weka.classifiers.meta.FilteredClassifierinstance - the instance to be classified
Exception - if instance could not be classified successfully
public double[][] predictIntervals(weka.core.Instance instance,
double confidenceLevel)
throws Exception
predictIntervals in interface weka.classifiers.IntervalEstimatorinstance - the instance to make the prediction for.confidenceLevel - the percentage of cases that the interval should cover.
Exception - if the intervals can't be computedpublic String getRevision()
getRevision in interface weka.core.RevisionHandlergetRevision in class weka.classifiers.meta.FilteredClassifierpublic static void main(String[] args)
args - the parameters, use -h to display them
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||