public class ReplaceMissingWithUserConstant extends PotentialClassIgnorer implements UnsupervisedFilter, StreamableFilter, EnvironmentHandler, WeightedInstancesHandler, WeightedAttributesHandler
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, setIgnoreClass
batchFilterFile, batchFinished, debugTipText, doNotCheckCapabilitiesTipText, filterFile, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, postExecution, preExecution, run, runFilter, setDebug, setDoNotCheckCapabilities, toString, useFilter, wekaStaticWrapper
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public java.lang.String globalInfo()
public Capabilities getCapabilities()
Filter
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
public java.util.Enumeration<Option> listOptions()
PotentialClassIgnorer
listOptions
in interface OptionHandler
listOptions
in class PotentialClassIgnorer
public 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 OptionHandler
setOptions
in class PotentialClassIgnorer
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
PotentialClassIgnorer
getOptions
in interface OptionHandler
getOptions
in class PotentialClassIgnorer
public 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
PotentialClassIgnorer
super.setInputFormat(Instances)
setInputFormat
in class PotentialClassIgnorer
instanceInfo
- 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
Filter
input
in class Filter
inst
- 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)
EnvironmentHandler
setEnvironment
in interface EnvironmentHandler
env
- the environment variables to
usepublic java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Filter
public static void main(java.lang.String[] args)
args
- should contain arguments to the filter: use -h for help