public class ReplaceMissingWithUserConstant extends PotentialClassIgnorer implements UnsupervisedFilter, StreamableFilter, EnvironmentHandler, WeightedInstancesHandler, WeightedAttributesHandler
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
m_dateConstant
Constant for replacing missing values in date attributes with
|
protected double |
m_dateConstVal
Parsed date value as a double
|
protected java.lang.String |
m_defaultDateFormat
Formatting string to use for parsing the date constant
|
protected Environment |
m_env
Environment variables
|
protected java.lang.String |
m_nominalStringConstant
Constant for replacing missing values in nominal/string atts with
|
protected java.lang.String |
m_numericConstant
Constant for replacing missing values in numeric attributes with
|
protected double |
m_numericConstVal
Parsed numeric constant value
|
protected java.lang.String |
m_range |
protected java.lang.String |
m_resolvedDateConstant
Replacement value for date atts after resolving environment vars
|
protected java.lang.String |
m_resolvedDateFormat
Formatting string after resolving environment vars
|
protected java.lang.String |
m_resolvedNominalStringConstant
Replacement value for nominal/string atts after resolving environment vars
|
protected java.lang.String |
m_resolvedNumericConstant
Replacement value for numeric atts after resolving environment vars
|
protected java.lang.String |
m_resolvedRange |
protected Range |
m_selectedRange
Range of columns to consider
|
m_ClassIndex, m_IgnoreClassm_Debug, m_DoNotCheckCapabilities, m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts| Constructor and Description |
|---|
ReplaceMissingWithUserConstant() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
attributesTipText()
Tip text for this property suitable for displaying in the GUI.
|
java.lang.String |
dateFormatTipText()
Tip text for this property suitable for displaying in the GUI.
|
java.lang.String |
dateReplacementValueTipText()
Tip text for this property suitable for displaying in the GUI.
|
java.lang.String |
getAttributes()
Get the list of attributes to consider for replacing missing values
|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
java.lang.String |
getDateFormat()
Get the date format to use for parsing the date replacement constant
|
java.lang.String |
getDateReplacementValue()
Get the date replacement value
|
java.lang.String |
getNominalStringReplacementValue()
Get the nominal/string replacement value
|
java.lang.String |
getNumericReplacementValue()
Get the numeric replacement value
|
java.lang.String[] |
getOptions()
Gets the current settings of the filter.
|
java.lang.String |
getRevision()
Returns the revision string.
|
java.lang.String |
globalInfo()
Returns a string describing this filter
|
boolean |
input(Instance inst)
Input an instance for filtering.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method for testing this class.
|
java.lang.String |
nominalStringReplacementValueTipText()
Tip text for this property suitable for displaying in the GUI.
|
java.lang.String |
numericReplacementValueTipText()
Tip text for this property suitable for displaying in the GUI.
|
void |
setAttributes(java.lang.String range)
Set the list of attributes to consider for replacing missing values
|
void |
setDateFormat(java.lang.String dateFormat)
Set the date format to use for parsing the date replacement constant
|
void |
setDateReplacementValue(java.lang.String dateConstant)
Set the date replacement value
|
void |
setEnvironment(Environment env)
Set environment variables to use.
|
boolean |
setInputFormat(Instances instanceInfo)
Sets the format of the input instances.
|
void |
setNominalStringReplacementValue(java.lang.String nominalStringConstant)
Set the nominal/string replacement value
|
void |
setNumericReplacementValue(java.lang.String numericConstant)
Set the numeric replacement value
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
getIgnoreClass, getOutputFormat, ignoreClassTipText, setIgnoreClassbatchFilterFile, batchFinished, bufferInput, copyValues, copyValues, debugTipText, doNotCheckCapabilitiesTipText, filterFile, flushInput, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, getInputFormat, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputFormatPeek, outputPeek, postExecution, preExecution, push, push, resetQueue, run, runFilter, setDebug, setDoNotCheckCapabilities, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapperprotected transient Environment m_env
protected Range m_selectedRange
protected java.lang.String m_range
protected java.lang.String m_resolvedRange
protected java.lang.String m_nominalStringConstant
protected java.lang.String m_resolvedNominalStringConstant
protected java.lang.String m_numericConstant
protected java.lang.String m_resolvedNumericConstant
protected double m_numericConstVal
protected java.lang.String m_dateConstant
protected java.lang.String m_resolvedDateConstant
protected double m_dateConstVal
protected java.lang.String m_defaultDateFormat
protected java.lang.String m_resolvedDateFormat
public java.lang.String globalInfo()
public Capabilities getCapabilities()
FiltergetCapabilities in interface CapabilitiesHandlergetCapabilities in class FilterCapabilitiespublic java.util.Enumeration<Option> listOptions()
PotentialClassIgnorerlistOptions in interface OptionHandlerlistOptions in class PotentialClassIgnorerpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
-A <index1,index2-index4,... | att-name1,att-name2,...> Specify list of attributes to replace missing values for (as weka range list of indices or a comma separated list of attribute names). (default: consider all attributes)
-N Specify the replacement constant for nominal/string attributes
-R Specify the replacement constant for numeric attributes (default: 0)
-D Specify the replacement constant for date attributes
-F Specify the date format for parsing the replacement date constant (default: yyyy-MM-dd'T'HH:mm:ss)
-unset-class-temporarily Unsets the class index temporarily before the filter is applied to the data. (default: no)
setOptions in interface OptionHandlersetOptions in class PotentialClassIgnoreroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
PotentialClassIgnorergetOptions in interface OptionHandlergetOptions in class PotentialClassIgnorerpublic java.lang.String attributesTipText()
public void setAttributes(java.lang.String range)
range - the list of attributes to considerpublic java.lang.String getAttributes()
public java.lang.String nominalStringReplacementValueTipText()
public java.lang.String getNominalStringReplacementValue()
public void setNominalStringReplacementValue(java.lang.String nominalStringConstant)
nominalStringConstant - the nominal/string constant to usepublic java.lang.String numericReplacementValueTipText()
public java.lang.String getNumericReplacementValue()
public void setNumericReplacementValue(java.lang.String numericConstant)
numericConstant - the numeric replacement valuepublic java.lang.String dateReplacementValueTipText()
public void setDateReplacementValue(java.lang.String dateConstant)
dateConstant - the date replacement valuepublic java.lang.String getDateReplacementValue()
public java.lang.String dateFormatTipText()
public void setDateFormat(java.lang.String dateFormat)
dateFormat - the date format to usepublic java.lang.String getDateFormat()
public boolean setInputFormat(Instances instanceInfo) throws java.lang.Exception
PotentialClassIgnorersuper.setInputFormat(Instances)setInputFormat in class PotentialClassIgnorerinstanceInfo - an Instances object containing the input instance
structure (any instances contained in the object are ignored -
only the structure is required).java.lang.Exception - if the inputFormat can't be set successfullypublic boolean input(Instance inst) throws java.lang.Exception
Filterinput in class Filterinst - the input instancejava.lang.NullPointerException - if the input format has not been defined.java.lang.Exception - if the input instance was not of the correct format or if
there was a problem with the filtering.public void setEnvironment(Environment env)
EnvironmentHandlersetEnvironment in interface EnvironmentHandlerenv - the environment variables to
usepublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class Filterpublic static void main(java.lang.String[] args)
args - should contain arguments to the filter: use -h for help