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).

Version:
$Revision: 1.7 $
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

Constructor Detail

 o AttributeSelectedClassifier
public AttributeSelectedClassifier()

Method Detail

 o globalInfo
public java.lang.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 java.util.Enumeration listOptions()
          Returns an enumeration describing the available options
Returns:
an enumeration of all the available options
 o setOptions
public void setOptions(java.lang.String options[]) throws java.lang.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:
java.lang.Exception - if an option is not supported
 o getOptions
public java.lang.String[] getOptions()
          Gets the current settings of the Classifier.
Returns:
an array of strings suitable for passing to setOptions
 o classifierTipText
public java.lang.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 java.lang.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 java.lang.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 java.lang.Exception
          Build the classifier on the dimensionally reduced data.
Parameters:
data - the training data
Throws:
java.lang.Exception - if the classifier could not be built successfully
Overrides:
buildClassifier in class Classifier
 o distributionForInstance
public double[] distributionForInstance(Instance instance) throws java.lang.Exception
          Classifies a given instance after attribute selection
Parameters:
instance - the instance to be classified
Throws:
java.lang.Exception - if instance could not be classified successfully
Overrides:
distributionForInstance in class DistributionClassifier
 o toString
public java.lang.String toString()
          Output a representation of this classifier
Overrides:
toString in class java.lang.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 java.util.Enumeration enumerateMeasures()
          Returns an enumeration of the additional measure names
Returns:
an enumeration of the measure names
 o getMeasure
public double getMeasure(java.lang.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:
java.lang.IllegalArgumentException - if the named measure is not supported
 o main
public static void main(java.lang.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