All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.filters.AttributeTypeFilter

java.lang.Object
    |
    +----weka.filters.Filter
            |
            +----weka.filters.AttributeTypeFilter

public class AttributeTypeFilter
extends Filter
implements OptionHandler
An instance filter that deletes all attributes of a specified type from the dataset.

Valid filter-specific options are:

-T type
Specify the attribute type to delete. Valid values are "nominal", "numeric", and "string". (default "string")

Version:
$Revision: 1.9 $
Author:
Len Trigg (len@intelligenesis.net)

Variable Index

 o TAGS_ATTRIBUTES
 

Constructor Index

 o AttributeTypeFilter()
 

Method Index

 o getAttributeType()
Gets the type of attribute that will be deleted.
 o getOptions()
Gets the current settings of the filter.
 o input(Instance)
Input an instance for filtering.
 o listOptions()
Returns an enumeration describing the available options
 o main(String[])
Main method for testing this class.
 o setAttributeType(SelectedTag)
Sets the type of attribute to delete.
 o setInputFormat(Instances)
Sets the format of the input instances.
 o setOptions(String[])
Parses a given list of options controlling the behaviour of this object.

Field Detail

 o TAGS_ATTRIBUTES
public static final Tag[] TAGS_ATTRIBUTES

Constructor Detail

 o AttributeTypeFilter
public AttributeTypeFilter()

Method Detail

 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 controlling the behaviour of this object. Valid options are:

-T type
Specify the attribute type to delete. Valid values are "nominal", "numeric", and "string". (default "string")

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 filter.
Returns:
an array of strings suitable for passing to setOptions
 o getAttributeType
public SelectedTag getAttributeType()
          Gets the type of attribute that will be deleted. The ID will be one of Attribute.STRING, Attribute.NOMINAL, or Attribute.NUMERIC.
Returns:
the selected attribute type.
 o setAttributeType
public void setAttributeType(SelectedTag newType)
          Sets the type of attribute to delete. Values other than Attribute.STRING, Attribute.NOMINAL, or Attribute.NUMERIC will be ignored.
Parameters:
newAttributeType - the type of attribute to delete.
 o setInputFormat
public boolean setInputFormat(Instances instanceInfo) throws java.lang.Exception
          Sets the format of the input instances.
Parameters:
instanceInfo - an Instances object containing the input instance structure (any instances contained in the object are ignored - only the structure is required).
Returns:
true if the outputFormat may be collected immediately
Throws:
java.lang.Exception - if the format couldn't be set successfully
Overrides:
setInputFormat in class Filter
 o input
public boolean input(Instance instance)
          Input an instance for filtering. Ordinarily the instance is processed and made available for output immediately. Some filters require all instances be read before producing output.
Parameters:
instance - the input instance
Returns:
true if the filtered instance may now be collected with output().
Throws:
java.lang.IllegalStateException - if no input format has been defined.
Overrides:
input in class Filter
 o main
public static void main(java.lang.String argv[])
          Main method for testing this class.
Parameters:
argv - should contain arguments to the filter: use -h for help

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home