| |
|
| java.lang.Object weka.filters.Filter weka.filters.unsupervised.attribute.MakeIndicator
MakeIndicator | public class MakeIndicator extends Filter implements UnsupervisedFilter,StreamableFilter,OptionHandler(Code) | |
A filter that creates a new dataset with a boolean attribute replacing a nominal attribute. In the new dataset, a value of 1 is assigned to an instance that exhibits a particular range of attribute values, a 0 to an instance that doesn't. The boolean attribute is coded as numeric by default.
Valid options are:
-C <col>
Sets the attribute index.
-V <index1,index2-index4,...>
Specify the list of values to indicate. First and last are
valid indexes (default last)
-N <index>
Set if new boolean attribute nominal.
author: Eibe Frank (eibe@cs.waikato.ac.nz) version: $Revision: 1.5 $ |
serialVersionUID | final static long serialVersionUID(Code) | | for serialization
|
MakeIndicator | public MakeIndicator()(Code) | | Constructor
|
attributeIndexTipText | public String attributeIndexTipText()(Code) | | tip text for this property suitable fordisplaying in the explorer/experimenter gui |
getAttributeIndex | public String getAttributeIndex()(Code) | | Get the index of the attribute used.
the index of the attribute |
getCapabilities | public Capabilities getCapabilities()(Code) | | Returns the Capabilities of this filter.
the capabilities of this object See Also: Capabilities |
getNumeric | public boolean getNumeric()(Code) | | Check if new attribute is to be numeric.
true if new attribute is to be numeric |
getOptions | public String[] getOptions()(Code) | | Gets the current settings of the filter.
an array of strings suitable for passing to setOptions |
getValueIndices | public String getValueIndices()(Code) | | Get the indices of the indicator values.
the indices of the indicator values |
getValueRange | public Range getValueRange()(Code) | | Get the range containing the indicator values.
the range containing the indicator values |
globalInfo | public String globalInfo()(Code) | | a description of the filter suitable fordisplaying in the explorer/experimenter gui |
input | public boolean input(Instance instance)(Code) | | Input an instance for filtering. The instance is processed
and made available for output immediately.
Parameters: instance - the input instance true if the filtered instance may now becollected with output(). throws: IllegalStateException - if no input format has been set. |
listOptions | public Enumeration listOptions()(Code) | | Returns an enumeration describing the available options.
an enumeration of all the available options. |
main | public static void main(String[] argv)(Code) | | Main method for testing this class.
Parameters: argv - should contain arguments to the filter: use -h for help |
numericTipText | public String numericTipText()(Code) | | tip text for this property suitable fordisplaying in the explorer/experimenter gui |
setAttributeIndex | public void setAttributeIndex(String attIndex)(Code) | | Sets index of the attribute used.
Parameters: attIndex - the index of the attribute |
setInputFormat | public boolean setInputFormat(Instances instanceInfo) throws Exception(Code) | | 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). true if the outputFormat may be collected immediately throws: UnsupportedAttributeTypeException - the selecte attribute is not nominal throws: UnsupportedAttributeTypeException - the selecte attribute has fewer than two values. |
setNumeric | public void setNumeric(boolean bool)(Code) | | Sets if the new Attribute is to be numeric.
Parameters: bool - true if new Attribute is to be numeric |
setOptions | public void setOptions(String[] options) throws Exception(Code) | | Parses a given list of options.
Valid options are:
-C <col>
Sets the attribute index.
-V <index1,index2-index4,...>
Specify the list of values to indicate. First and last are
valid indexes (default last)
-N <index>
Set if new boolean attribute nominal.
Parameters: options - the list of options as an array of strings throws: Exception - if an option is not supported |
setValueIndex | public void setValueIndex(int index)(Code) | | Sets index of the indicator value.
Parameters: index - the index of the indicator value |
setValueIndices | public void setValueIndices(String range)(Code) | | Sets indices of the indicator values.
Parameters: range - the string representation of the indicator value indices See Also: Range |
setValueIndicesArray | public void setValueIndicesArray(int[] indices)(Code) | | Set which attributes are to be deleted (or kept if invert is true)
Parameters: indices - an array containing indexes of attributes to select.Since the array will typically come from a program, attributes are indexedfrom 0. throws: InvalidArgumentException - if an invalid set of ranges is supplied |
valueIndicesTipText | public String valueIndicesTipText()(Code) | | tip text for this property suitable fordisplaying in the explorer/experimenter gui |
Methods inherited from weka.filters.Filter | public static void batchFilterFile(Filter filter, String[] options) throws Exception(Code)(Java Doc) public boolean batchFinished() throws Exception(Code)(Java Doc) protected void bufferInput(Instance instance)(Code)(Java Doc) protected void copyValues(Instance instance, boolean isInput)(Code)(Java Doc) protected void copyValues(Instance instance, boolean instSrcCompat, Instances srcDataset, Instances destDataset)(Code)(Java Doc) public static void filterFile(Filter filter, String[] options) throws Exception(Code)(Java Doc) protected void flushInput()(Code)(Java Doc) public Capabilities getCapabilities()(Code)(Java Doc) public Capabilities getCapabilities(Instances data)(Code)(Java Doc) protected Instances getInputFormat()(Code)(Java Doc) public Instances getOutputFormat()(Code)(Java Doc) protected void initInputLocators(Instances data, int[] indices)(Code)(Java Doc) protected void initOutputLocators(Instances data, int[] indices)(Code)(Java Doc) public boolean input(Instance instance) throws Exception(Code)(Java Doc) protected Instances inputFormatPeek()(Code)(Java Doc) public boolean isFirstBatchDone()(Code)(Java Doc) public boolean isNewBatch()(Code)(Java Doc) public boolean isOutputFormatDefined()(Code)(Java Doc) public static void main(String[] args)(Code)(Java Doc) public static Filter[] makeCopies(Filter model, int num) throws Exception(Code)(Java Doc) public static Filter makeCopy(Filter model) throws Exception(Code)(Java Doc) public int numPendingOutput()(Code)(Java Doc) public Instance output()(Code)(Java Doc) protected Instances outputFormatPeek()(Code)(Java Doc) public Instance outputPeek()(Code)(Java Doc) protected void push(Instance instance)(Code)(Java Doc) protected void resetQueue()(Code)(Java Doc) protected static void runFilter(Filter filter, String[] options)(Code)(Java Doc) public boolean setInputFormat(Instances instanceInfo) throws Exception(Code)(Java Doc) protected void setOutputFormat(Instances outputFormat)(Code)(Java Doc) protected void testInputFormat(Instances instanceInfo) throws Exception(Code)(Java Doc) public static Instances useFilter(Instances data, Filter filter) throws Exception(Code)(Java Doc)
|
|
|
|