|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.filters.Filter
weka.filters.SimpleFilter
weka.filters.SimpleBatchFilter
weka.filters.unsupervised.instance.AbstractRowFinderApplier
weka.filters.unsupervised.instance.DatasetLabeler
public class DatasetLabeler
Adds an additional attribute to the dataset containing a label whether it was a match or not, i.e., whether the row finder selected a particular row or not.
Valid options are:-D Turns on output of debugging information.
-W <row finder specification> Full class name of row finder to use, followed by scheme options. eg: "adams.data.weka.rowfinder.NullFinder -D 1" (default: adams.data.weka.rowfinder.NullFinder)
-invert Whether to invert the found row indices. (default: off)
-name <name> Name of the label attribute. (default: 'Label')
-match <label> The label for matching rows. (default: 'yes')
-non-match <label> The label for non-matching rows. (default: 'no')
| Field Summary | |
|---|---|
static String |
DEFAULT_NAME
the default name of the attribute. |
static String |
LABEL_MATCH
the default label for a "match". |
static String |
LABEL_NONMATCH
the default label for a "non-match". |
protected weka.filters.unsupervised.attribute.Add |
m_AddFilter
the filter for adding the label attribute. |
protected String |
m_AttributeName
the name of the attribute name to add. |
protected String |
m_LabelMatch
the label to use for a match. |
protected String |
m_LabelNonMatch
the label to use for a nonmatch. |
| Fields inherited from class weka.filters.unsupervised.instance.AbstractRowFinderApplier |
|---|
m_Invert, m_RowFinder |
| Fields inherited from class weka.filters.SimpleFilter |
|---|
m_Debug |
| Fields inherited from class weka.filters.Filter |
|---|
m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts |
| Constructor Summary | |
|---|---|
DatasetLabeler()
|
|
| Method Summary | |
|---|---|
protected weka.core.Instances |
apply(weka.core.Instances data,
int[] indices)
Applies the indices to the data. |
String |
attributeNameTipText()
Returns the tip text for this property. |
protected weka.core.Instances |
determineOutputFormat(weka.core.Instances inputFormat)
Determines the output format based on the input format and returns this. |
String |
getAttributeName()
Get the name of the attribute to be created. |
String |
getLabelMatch()
Returns the label for the matching rows. |
String |
getLabelNonMatch()
Returns the label for the non-matching rows. |
String[] |
getOptions()
Gets the current settings of the classifier. |
String |
getRevision()
Returns the revision string. |
String |
globalInfo()
Returns a string describing this classifier. |
String |
labelMatchTipText()
Returns the tip text for this property. |
String |
labelNonMatchTipText()
Returns the tip text for this property. |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
protected boolean |
mayRemoveInstances()
Method that returns whether the filter may remove instances after the first batch has been done. |
String |
rowFinderTipText()
Returns the tip text for this property. |
void |
setAttributeName(String name)
Set the new attribute's name. |
void |
setLabelMatch(String value)
Sets the label for the matching rows. |
void |
setLabelNonMatch(String value)
Sets the label for the non-matching rows. |
void |
setOptions(String[] options)
Parses the options for this object. |
| Methods inherited from class weka.filters.unsupervised.instance.AbstractRowFinderApplier |
|---|
getCapabilities, getInvert, getRowFinder, invertTipText, mayRemoveInstanceAfterFirstBatchDone, process, setInvert, setRowFinder |
| Methods inherited from class weka.filters.SimpleBatchFilter |
|---|
batchFinished, hasImmediateOutputFormat, input |
| Methods inherited from class weka.filters.SimpleFilter |
|---|
debugTipText, getDebug, reset, setDebug, setInputFormat |
| Methods inherited from class weka.filters.Filter |
|---|
batchFilterFile, bufferInput, copyValues, copyValues, filterFile, flushInput, getCapabilities, getInputFormat, getOutputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, main, makeCopies, makeCopy, numPendingOutput, output, outputFormatPeek, outputPeek, push, resetQueue, runFilter, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String LABEL_MATCH
public static final String LABEL_NONMATCH
public static final String DEFAULT_NAME
protected String m_AttributeName
protected String m_LabelMatch
protected String m_LabelNonMatch
protected weka.filters.unsupervised.attribute.Add m_AddFilter
| Constructor Detail |
|---|
public DatasetLabeler()
| Method Detail |
|---|
public String globalInfo()
globalInfo in class weka.filters.SimpleFilterpublic Enumeration listOptions()
listOptions in interface weka.core.OptionHandlerlistOptions in class AbstractRowFinderApplier
public void setOptions(String[] options)
throws Exception
setOptions in interface weka.core.OptionHandlersetOptions in class AbstractRowFinderApplieroptions - the options to use
Exception - if setting of options failspublic String[] getOptions()
getOptions in interface weka.core.OptionHandlergetOptions in class AbstractRowFinderApplierpublic String rowFinderTipText()
rowFinderTipText in class AbstractRowFinderApplierpublic void setAttributeName(String name)
name - the new namepublic String getAttributeName()
public String attributeNameTipText()
public void setLabelMatch(String value)
name - the labelpublic String getLabelMatch()
public String labelMatchTipText()
public void setLabelNonMatch(String value)
name - the labelpublic String getLabelNonMatch()
public String labelNonMatchTipText()
protected weka.core.Instances determineOutputFormat(weka.core.Instances inputFormat)
throws Exception
determineOutputFormat in class AbstractRowFinderApplierinputFormat - the input format to base the output format on
Exception - in case the determination goes wrongprotected boolean mayRemoveInstances()
mayRemoveInstances in class AbstractRowFinderApplierAbstractRowFinderApplier.mayRemoveInstanceAfterFirstBatchDone()
protected weka.core.Instances apply(weka.core.Instances data,
int[] indices)
apply in class AbstractRowFinderApplierdata - the data to processindices - the indices to use
public String getRevision()
getRevision in interface weka.core.RevisionHandlergetRevision in class weka.filters.Filter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||