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)

Constructor Index

 o AttributeSelectedClassifier()

Method Index

 o buildClassifier(Instances)
Build the classifier on the dimensionally reduced data.
 o classifierTipText()
Returns the tip text for this property
 o distributionForInstance(Instance)
Classifies a given instance after attribute selection
 o enumerateMeasures()
Returns an enumeration of the additional measure names
 o evaluatorTipText()
Returns the tip text for this property
 o getClassifier()
Gets the classifier used.
 o getEvaluator()
Gets the attribute evaluator used
 o getMeasure(String)
Returns the value of the named measure
 o getOptions()
Gets the current settings of the Classifier.
 o getSearch()
Gets the search method used
 o globalInfo()
Returns a string describing this search method
 o listOptions()
Returns an enumeration describing the available options
 o main(String[])
Main method for testing this class.
 o measureNumAttributesSelected()
Additional measure --- number of attributes selected
 o measureSelectionTime()
Additional measure --- time taken (milliseconds) to select the attributes
 o measureTime()
Additional measure --- time taken (milliseconds) to select attributes and build the classifier
 o searchTipText()
Returns the tip text for this property
 o setClassifier(Classifier)
Sets the classifier
 o setEvaluator(ASEvaluation)
Sets the attribute evaluator
 o setOptions(String[])
Parses a given list of options.
 o setSearch(ASSearch)
Sets the search method
 o toString()
Output a representation of this classifier

Constructors

 o AttributeSelectedClassifier
 public AttributeSelectedClassifier()

Methods

 o 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
 o listOptions
 public Enumeration listOptions()
Returns an enumeration describing the available options

Returns:
an enumeration of all the available options
 o 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
 o getOptions
 public String[] getOptions()
Gets the current settings of the Classifier.

Returns:
an array of strings suitable for passing to setOptions
 o 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
 o setClassifier
 public void setClassifier(Classifier classifier)
Sets the classifier

Parameters:
classifier - the classifier with all options set.
 o getClassifier
 public Classifier getClassifier()
Gets the classifier used.

Returns:
the classifier
 o 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
 o setEvaluator
 public void setEvaluator(ASEvaluation evaluator)
Sets the attribute evaluator

Parameters:
evaluator - the evaluator with all options set.
 o getEvaluator
 public ASEvaluation getEvaluator()
Gets the attribute evaluator used

Returns:
the attribute evaluator
 o 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
 o setSearch
 public void setSearch(ASSearch search)
Sets the search method

Parameters:
search - the search method with all options set.
 o getSearch
 public ASSearch getSearch()
Gets the search method used

Returns:
the search method
 o 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
 o 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
 o toString
 public String toString()
Output a representation of this classifier

Overrides:
toString in class Object
 o measureNumAttributesSelected
 public double measureNumAttributesSelected()
Additional measure --- number of attributes selected

Returns:
the number of attributes selected
 o measureSelectionTime
 public double measureSelectionTime()
Additional measure --- time taken (milliseconds) to select the attributes

Returns:
the time taken to select attributes
 o measureTime
 public double measureTime()
Additional measure --- time taken (milliseconds) to select attributes and build the classifier

Returns:
the total time (select attributes + build classifier)
 o enumerateMeasures
 public Enumeration enumerateMeasures()
Returns an enumeration of the additional measure names

Returns:
an enumeration of the measure names
 o 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
 o 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