|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.meta.AttributeSelectedClassifier
Class for running an arbitrary classifier on data that has been reduced through attribute selection.
Valid options from the command line are:
-W classifierstring
Classifierstring should contain the full class name of a classifier
followed by options to the classifier.
(required).
-E evaluatorstring
Evaluatorstring should contain the full class name of an attribute
evaluator followed by any options.
(required).
-S searchstring
Searchstring should contain the full class name of a search method
followed by any options.
(required).
Field Summary | |
protected AttributeSelection |
m_AttributeSelection
The attribute selection object |
protected Classifier |
m_Classifier
The classifier |
protected ASEvaluation |
m_Evaluator
The attribute evaluator to use |
protected double |
m_numAttributesSelected
The number of attributes selected by the attribute selection phase |
protected int |
m_numClasses
The number of class vals in the training data (1 if class is numeric) |
protected Instances |
m_ReducedHeader
The header of the dimensionally reduced data |
protected ASSearch |
m_Search
The search method to use |
protected double |
m_selectionTime
The time taken to select attributes in milliseconds |
protected double |
m_totalTime
The time taken to select attributes AND build the classifier |
Fields inherited from class weka.classifiers.Classifier |
m_Debug |
Fields inherited from interface weka.core.Drawable |
BayesNet, NOT_DRAWABLE, TREE |
Constructor Summary | |
AttributeSelectedClassifier()
|
Method Summary | |
void |
buildClassifier(Instances data)
Build the classifier on the dimensionally reduced data. |
java.lang.String |
classifierTipText()
Returns the tip text for this property |
double[] |
distributionForInstance(Instance instance)
Classifies a given instance after attribute selection |
java.util.Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names |
java.lang.String |
evaluatorTipText()
Returns the tip text for this property |
Classifier |
getClassifier()
Gets the classifier used. |
protected java.lang.String |
getClassifierSpec()
Gets the classifier specification string, which contains the class name of the classifier and any options to the classifier |
ASEvaluation |
getEvaluator()
Gets the attribute evaluator used |
protected java.lang.String |
getEvaluatorSpec()
Gets the evaluator specification string, which contains the class name of the attribute evaluator and any options to it |
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
ASSearch |
getSearch()
Gets the search method used |
protected java.lang.String |
getSearchSpec()
Gets the search specification string, which contains the class name of the search method and any options to it |
java.lang.String |
globalInfo()
Returns a string describing this search method |
java.lang.String |
graph()
Returns graph describing the classifier (if possible). |
int |
graphType()
Returns the type of graph this classifier represents. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.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 |
java.lang.String |
searchTipText()
Returns the tip text for this property |
void |
setClassifier(Classifier classifier)
Sets the classifier |
void |
setEvaluator(ASEvaluation evaluator)
Sets the attribute evaluator |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setSearch(ASSearch search)
Sets the search method |
java.lang.String |
toString()
Output a representation of this classifier |
Methods inherited from class weka.classifiers.Classifier |
classifyInstance, debugTipText, forName, getDebug, makeCopies, setDebug |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Classifier m_Classifier
protected AttributeSelection m_AttributeSelection
protected ASEvaluation m_Evaluator
protected ASSearch m_Search
protected Instances m_ReducedHeader
protected int m_numClasses
protected double m_numAttributesSelected
protected double m_selectionTime
protected double m_totalTime
Constructor Detail |
public AttributeSelectedClassifier()
Method Detail |
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class Classifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-W classifierstring
Classifierstring should contain the full class name of a classifier
followed by options to the classifier.
(required).
-E evaluatorstring
Evaluatorstring should contain the full class name of an attribute
evaluator followed by any options.
(required).
-S searchstring
Searchstring should contain the full class name of a search method
followed by any options.
(required).
setOptions
in interface OptionHandler
setOptions
in class Classifier
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
getOptions
in class Classifier
public java.lang.String classifierTipText()
public void setClassifier(Classifier classifier)
classifier
- the classifier with all options set.public Classifier getClassifier()
protected java.lang.String getClassifierSpec()
public java.lang.String evaluatorTipText()
public void setEvaluator(ASEvaluation evaluator)
evaluator
- the evaluator with all options set.public ASEvaluation getEvaluator()
protected java.lang.String getEvaluatorSpec()
public java.lang.String searchTipText()
public void setSearch(ASSearch search)
search
- the search method with all options set.public ASSearch getSearch()
protected java.lang.String getSearchSpec()
public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class Classifier
data
- the training data
java.lang.Exception
- if the classifier could not be built successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class Classifier
instance
- the instance to be classified
java.lang.Exception
- if instance could not be classified
successfullypublic int graphType()
graphType
in interface Drawable
public java.lang.String graph() throws java.lang.Exception
graph
in interface Drawable
java.lang.Exception
- if the classifier cannot be graphedpublic java.lang.String toString()
public double measureNumAttributesSelected()
public double measureSelectionTime()
public double measureTime()
public java.util.Enumeration enumerateMeasures()
enumerateMeasures
in interface AdditionalMeasureProducer
public double getMeasure(java.lang.String additionalMeasureName)
getMeasure
in interface AdditionalMeasureProducer
additionalMeasureName
- the name of the measure to query for its value
java.lang.IllegalArgumentException
- if the named measure is not supportedpublic static void main(java.lang.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 |