All Packages Class Hierarchy This Package Previous Next Index WEKA's home
Class weka.classifiers.AttributeSelectedClassifier
java.lang.Object
|
+----weka.classifiers.Classifier
|
+----weka.classifiers.DistributionClassifier
|
+----weka.classifiers.AttributeSelectedClassifier
- public class AttributeSelectedClassifier
- extends DistributionClassifier
- implements OptionHandler, AdditionalMeasureProducer
Class for running an arbitrary classifier on data that has been reduced
through attribute selection.
Valid options from the command line are:
-B 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).
- Author:
- Mark Hall (mhall@cs.waikato.ac.nz)
-
AttributeSelectedClassifier()
-
-
buildClassifier(Instances)
- Build the classifier on the dimensionally reduced data.
-
classifierTipText()
- Returns the tip text for this property
-
distributionForInstance(Instance)
- Classifies a given instance after attribute selection
-
enumerateMeasures()
- Returns an enumeration of the additional measure names
-
evaluatorTipText()
- Returns the tip text for this property
-
getClassifier()
- Gets the classifier used.
-
getEvaluator()
- Gets the attribute evaluator used
-
getMeasure(String)
- Returns the value of the named measure
-
getOptions()
- Gets the current settings of the Classifier.
-
getSearch()
- Gets the search method used
-
globalInfo()
- Returns a string describing this search method
-
listOptions()
- Returns an enumeration describing the available options
-
main(String[])
- Main method for testing this class.
-
measureNumAttributesSelected()
- Additional measure --- number of attributes selected
-
measureSelectionTime()
- Additional measure --- time taken (milliseconds) to select the attributes
-
measureTime()
- Additional measure --- time taken (milliseconds) to select attributes
and build the classifier
-
searchTipText()
- Returns the tip text for this property
-
setClassifier(Classifier)
- Sets the classifier
-
setEvaluator(ASEvaluation)
- Sets the attribute evaluator
-
setOptions(String[])
- Parses a given list of options.
-
setSearch(ASSearch)
- Sets the search method
-
toString()
- Output a representation of this classifier
AttributeSelectedClassifier
public AttributeSelectedClassifier()
globalInfo
public String globalInfo()
- Returns a string describing this search method
- Returns:
- a description of the search method suitable for
displaying in the explorer/experimenter gui
listOptions
public Enumeration listOptions()
- Returns an enumeration describing the available options
- Returns:
- an enumeration of all the available options
setOptions
public void setOptions(String options[]) throws Exception
- Parses a given list of options. Valid options are:
-B 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).
- Parameters:
- options - the list of options as an array of strings
- Throws: Exception
- if an option is not supported
getOptions
public String[] getOptions()
- Gets the current settings of the Classifier.
- Returns:
- an array of strings suitable for passing to setOptions
classifierTipText
public String classifierTipText()
- Returns the tip text for this property
- Returns:
- tip text for this property suitable for
displaying in the explorer/experimenter gui
setClassifier
public void setClassifier(Classifier classifier)
- Sets the classifier
- Parameters:
- classifier - the classifier with all options set.
getClassifier
public Classifier getClassifier()
- Gets the classifier used.
- Returns:
- the classifier
evaluatorTipText
public String evaluatorTipText()
- Returns the tip text for this property
- Returns:
- tip text for this property suitable for
displaying in the explorer/experimenter gui
setEvaluator
public void setEvaluator(ASEvaluation evaluator)
- Sets the attribute evaluator
- Parameters:
- evaluator - the evaluator with all options set.
getEvaluator
public ASEvaluation getEvaluator()
- Gets the attribute evaluator used
- Returns:
- the attribute evaluator
searchTipText
public String searchTipText()
- Returns the tip text for this property
- Returns:
- tip text for this property suitable for
displaying in the explorer/experimenter gui
setSearch
public void setSearch(ASSearch search)
- Sets the search method
- Parameters:
- search - the search method with all options set.
getSearch
public ASSearch getSearch()
- Gets the search method used
- Returns:
- the search method
buildClassifier
public void buildClassifier(Instances data) throws Exception
- Build the classifier on the dimensionally reduced data.
- Parameters:
- data - the training data
- Throws: Exception
- if the classifier could not be built successfully
- Overrides:
- buildClassifier in class Classifier
distributionForInstance
public double[] distributionForInstance(Instance instance) throws Exception
- Classifies a given instance after attribute selection
- Parameters:
- instance - the instance to be classified
- Throws: Exception
- if instance could not be classified
successfully
- Overrides:
- distributionForInstance in class DistributionClassifier
toString
public String toString()
- Output a representation of this classifier
- Overrides:
- toString in class Object
measureNumAttributesSelected
public double measureNumAttributesSelected()
- Additional measure --- number of attributes selected
- Returns:
- the number of attributes selected
measureSelectionTime
public double measureSelectionTime()
- Additional measure --- time taken (milliseconds) to select the attributes
- Returns:
- the time taken to select attributes
measureTime
public double measureTime()
- Additional measure --- time taken (milliseconds) to select attributes
and build the classifier
- Returns:
- the total time (select attributes + build classifier)
enumerateMeasures
public Enumeration enumerateMeasures()
- Returns an enumeration of the additional measure names
- Returns:
- an enumeration of the measure names
getMeasure
public double getMeasure(String additionalMeasureName)
- Returns the value of the named measure
- Parameters:
- measureName - the name of the measure to query for its value
- Returns:
- the value of the named measure
- Throws: IllegalArgumentException
- if the named measure is not supported
main
public static void main(String argv[])
- Main method for testing this class.
- Parameters:
- argv - should contain the following arguments:
-t training file [-T test file] [-c class index]
All Packages Class Hierarchy This Package Previous Next Index WEKA's home