public class ReplaceMissingValuesFilter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
m_NewBatch
Record whether the filter is at the start of a batch
|
Constructor and Description |
---|
ReplaceMissingValuesFilter() |
Modifier and Type | Method and Description |
---|---|
boolean |
batchFinished()
Signify that this batch of input to the filter is finished.
|
protected void |
bufferInput(M5Instance instance)
Buffers a input format.
|
protected void |
copyStringValues(M5Instance instance,
boolean instSrcCompat,
M5Instances srcDataset,
int[] srcStrAtts,
M5Instances destDataset,
int[] destStrAtts)
Copies the values from a given dataset to other.
|
protected void |
copyStringValues(M5Instance instance,
boolean instSrcCompat,
M5Instances srcDataset,
M5Instances destDataset)
Copies the values from a given dataset to other.
|
protected void |
flushInput()
Flushed the inputs (cleans the input formats)
|
protected M5Instances |
getInputFormat()
Returns the format of the input instances.
|
M5Instances |
getOutputFormat()
Returns the output format.
|
protected int[] |
getStringIndices(M5Instances insts)
Returns the indeces of the given instances.
|
boolean |
input(M5Instance instance)
Input an instance for filtering.
|
int |
numPendingOutput()
Returns the number of pending output.
|
M5Instance |
output()
Returns the outputs.
|
protected void |
push(M5Instance instance)
Pushes an instance format into the output queue.
|
protected void |
resetQueue()
Resets the output queue.
|
boolean |
setInputFormat(M5Instances instanceInfo)
Sets the format of the input instances.
|
protected void |
setOutputFormat(M5Instances outputFormat)
Sets the format of the output instances.
|
boolean |
superSetInputFormat(M5Instances instanceInfo)
Sets the format of the input instances.
|
static M5Instances |
useFilter(M5Instances data,
ReplaceMissingValuesFilter filter)
Uses the Missing value filter given as parameter to the given dat.
|
protected boolean m_NewBatch
public boolean setInputFormat(M5Instances instanceInfo) throws java.lang.Exception
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 input format can't be set
successfullyprotected int[] getStringIndices(M5Instances insts)
insts
- given instances.protected void setOutputFormat(M5Instances outputFormat)
outputFormat
- an Instances object containing the output
instance structure (any instances contained in the object are
ignored - only the structure is required).public boolean superSetInputFormat(M5Instances instanceInfo) throws java.lang.Exception
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 input format can't be set
successfullyprotected M5Instances getInputFormat()
public boolean input(M5Instance instance) throws java.lang.Exception
instance
- the input instancejava.lang.Exception
java.lang.IllegalStateException
- if no input format has been set.protected void resetQueue()
protected void bufferInput(M5Instance instance)
instance
- input format given.protected void copyStringValues(M5Instance instance, boolean instSrcCompat, M5Instances srcDataset, M5Instances destDataset)
instance
- input format.instSrcCompat
- True to compat the src datasetsrcDataset
- dataset to copy from.destDataset
- destiny dataset.protected void copyStringValues(M5Instance instance, boolean instSrcCompat, M5Instances srcDataset, int[] srcStrAtts, M5Instances destDataset, int[] destStrAtts)
instance
- input format.instSrcCompat
- True to compat the src datasetsrcDataset
- dataset to copy from.srcStrAtts
- attributes to copy.destDataset
- destiny dataset.destStrAtts
- destiny attributes.public boolean batchFinished() throws java.lang.Exception
java.lang.Exception
java.lang.IllegalStateException
- if no input structure has been definedprotected void flushInput()
public int numPendingOutput()
protected void push(M5Instance instance)
instance
- given instance.public static M5Instances useFilter(M5Instances data, ReplaceMissingValuesFilter filter) throws java.lang.Exception
data
- given dataset.filter
- Missing value filter.java.lang.Exception
- if the filter can not be applied.public final M5Instances getOutputFormat()
public M5Instance output()