|
||||||||||
| 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.AttributeSelectedClassifier
public class AttributeSelectedClassifier
Dimensionality of training and test data is reduced by attribute selection before being passed on to a classifier.
Valid options are:-E <attribute evaluator specification> Full class name of attribute evaluator, followed by its options. eg: "weka.attributeSelection.CfsSubsetEval -L" (default weka.attributeSelection.CfsSubsetEval)
-S <search method specification> Full class name of search method, followed by its options. eg: "weka.attributeSelection.BestFirst -D 1" (default weka.attributeSelection.BestFirst)
-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).
| Field Summary |
|---|
| Fields inherited from interface weka.core.Drawable |
|---|
BayesNet, Newick, NOT_DRAWABLE, TREE |
| Constructor Summary | |
|---|---|
AttributeSelectedClassifier()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
buildClassifier(Instances data)
Build the classifier on the dimensionally reduced data. |
double[] |
distributionForInstance(Instance instance)
Classifies a given instance after attribute selection |
Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names |
String |
evaluatorTipText()
Returns the tip text for this property |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
ASEvaluation |
getEvaluator()
Gets the attribute evaluator used |
double |
getMeasure(String additionalMeasureName)
Returns the value of the named measure |
String[] |
getOptions()
Gets the current settings of the Classifier. |
String |
getRevision()
Returns the revision string. |
ASSearch |
getSearch()
Gets the search method used |
String |
globalInfo()
Returns a string describing this search method |
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. |
double |
measureNumAttributesSelected()
Additional measure --- number of attributes selected |
double |
measureSelectionTime()
Additional measure --- time taken (milliseconds) to select the attributes |
double |
measureTime()
Additional measure --- time taken (milliseconds) to select attributes and build the classifier |
String |
searchTipText()
Returns the tip text for this property |
void |
setEvaluator(ASEvaluation evaluator)
Sets the attribute evaluator |
void |
setOptions(String[] options)
Parses a given list of options. |
void |
setSearch(ASSearch search)
Sets the search method |
String |
toString()
Output a representation of this classifier |
| Methods inherited from class weka.classifiers.SingleClassifierEnhancer |
|---|
classifierTipText, getClassifier, setClassifier |
| Methods inherited from class weka.classifiers.AbstractClassifier |
|---|
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebug |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AttributeSelectedClassifier()
| Method Detail |
|---|
public String globalInfo()
public Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class SingleClassifierEnhancer
public void setOptions(String[] options)
throws Exception
-E <attribute evaluator specification> Full class name of attribute evaluator, followed by its options. eg: "weka.attributeSelection.CfsSubsetEval -L" (default weka.attributeSelection.CfsSubsetEval)
-S <search method specification> Full class name of search method, followed by its options. eg: "weka.attributeSelection.BestFirst -D 1" (default weka.attributeSelection.BestFirst)
-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 strings
Exception - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlergetOptions in class SingleClassifierEnhancerpublic String evaluatorTipText()
public void setEvaluator(ASEvaluation evaluator)
evaluator - the evaluator with all options set.public ASEvaluation getEvaluator()
public String searchTipText()
public void setSearch(ASSearch search)
search - the search method with all options set.public ASSearch getSearch()
public Capabilities getCapabilities()
getCapabilities in interface ClassifiergetCapabilities in interface CapabilitiesHandlergetCapabilities in class SingleClassifierEnhancerCapabilities
public void buildClassifier(Instances data)
throws Exception
buildClassifier in interface Classifierdata - the training data
Exception - if the classifier could not be built successfully
public double[] distributionForInstance(Instance instance)
throws Exception
distributionForInstance in interface ClassifierdistributionForInstance in class AbstractClassifierinstance - the instance to be classified
Exception - if instance could not be classified
successfullypublic int graphType()
graphType in interface Drawable
public String graph()
throws Exception
graph in interface DrawableException - if the classifier cannot be graphedpublic String toString()
toString in class Objectpublic double measureNumAttributesSelected()
public double measureSelectionTime()
public double measureTime()
public Enumeration enumerateMeasures()
enumerateMeasures in interface AdditionalMeasureProducerpublic double getMeasure(String additionalMeasureName)
getMeasure in interface AdditionalMeasureProduceradditionalMeasureName - the name of the measure to query for its value
IllegalArgumentException - if the named measure is not supportedpublic 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]
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||