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")
- Author:
- Len Trigg (len@intelligenesis.net)
-
TAGS_ATTRIBUTES
-
-
AttributeTypeFilter()
-
-
getAttributeType()
- Gets the type of attribute that will be deleted.
-
getOptions()
- Gets the current settings of the filter.
-
input(Instance)
- Input an instance for filtering.
-
listOptions()
- Returns an enumeration describing the available options
-
main(String[])
- Main method for testing this class.
-
setAttributeType(SelectedTag)
- Sets the type of attribute to delete.
-
setInputFormat(Instances)
- Sets the format of the input instances.
-
setOptions(String[])
- Parses a given list of options controlling the behaviour of this object.
TAGS_ATTRIBUTES
public static final Tag TAGS_ATTRIBUTES[]
AttributeTypeFilter
public AttributeTypeFilter()
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 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: Exception
- if an option is not supported
getOptions
public String[] getOptions()
- Gets the current settings of the filter.
- Returns:
- an array of strings suitable for passing to setOptions
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.
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.
setInputFormat
public boolean setInputFormat(Instances instanceInfo) throws 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: Exception
- if the format couldn't be set successfully
- Overrides:
- setInputFormat in class Filter
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: IllegalStateException
- if no input format has been defined.
- Overrides:
- input in class Filter
main
public static void main(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