public class FilteredClassifier extends SingleClassifierEnhancer implements Drawable, PartitionGenerator
-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.
-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.
-Q <seed> Seed for random data shuffling (default 1).
BayesNet, Newick, NOT_DRAWABLE, TREE| Constructor and Description |
|---|
FilteredClassifier()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
buildClassifier(Instances data)
Build the classifier on the filtered data.
|
double[] |
distributionForInstance(Instance instance)
Classifies a given instance after filtering.
|
String |
filterTipText()
Returns the tip text for this property
|
void |
generatePartition(Instances data)
Builds the classifier to generate a partition.
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
Filter |
getFilter()
Gets the filter used.
|
double[] |
getMembershipValues(Instance inst)
Computes an array that has a value for each element in the partition.
|
String[] |
getOptions()
Gets the current settings of the Classifier.
|
String |
getRevision()
Returns the revision string.
|
String |
globalInfo()
Returns a string describing this classifier
|
String |
graph()
Returns graph describing the classifier (if possible).
|
int |
graphType()
Returns the type of graph this classifier
represents.
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] argv)
Main method for testing this class.
|
int |
numElements()
Returns the number of elements in the partition.
|
void |
setFilter(Filter filter)
Sets the filter
|
void |
setOptions(String[] options)
Parses a given list of options.
|
String |
toString()
Output a representation of this classifier
|
classifierTipText, getClassifier, setClassifierclassifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebugpublic String globalInfo()
public int graphType()
public void generatePartition(Instances data) throws Exception
generatePartition in interface PartitionGeneratorExceptionpublic double[] getMembershipValues(Instance inst) throws Exception
getMembershipValues in interface PartitionGeneratorExceptionpublic int numElements()
throws Exception
numElements in interface PartitionGeneratorExceptionpublic Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class SingleClassifierEnhancerpublic void setOptions(String[] options) throws Exception
-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.
-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.
-Q <seed> Seed for random data shuffling (default 1).
setOptions in interface OptionHandlersetOptions in class SingleClassifierEnhanceroptions - the list of options as an array of stringsException - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlergetOptions in class SingleClassifierEnhancerpublic String filterTipText()
public void setFilter(Filter filter)
filter - the filter with all options set.public Filter getFilter()
public Capabilities getCapabilities()
getCapabilities in interface ClassifiergetCapabilities in interface CapabilitiesHandlergetCapabilities in class SingleClassifierEnhancerCapabilitiespublic void buildClassifier(Instances data) throws Exception
buildClassifier in interface Classifierdata - the training dataException - if the classifier could not be built successfullypublic double[] distributionForInstance(Instance instance) throws Exception
distributionForInstance in interface ClassifierdistributionForInstance in class AbstractClassifierinstance - the instance to be classifiedException - if instance could not be classified
successfullypublic String toString()
public String getRevision()
getRevision in interface RevisionHandlergetRevision in class AbstractClassifierpublic static void main(String[] argv)
argv - should contain the following arguments:
-t training file [-T test file] [-c class index]Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.