@KFStep(name="Filter", category="Filters", toolTipText="Weka filter wrapper", iconPath="") public class Filter extends WekaAlgorithmWrapper
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.Integer,Filter> |
m_filterMap
Map of filters that have processed the first batch
|
protected Filter |
m_filterTemplate
Template filter
|
protected Data |
m_incrementalData
Data object to reuse when processing incrementally
|
protected boolean |
m_isReset
True if we've been reset
|
protected java.util.concurrent.atomic.AtomicInteger |
m_setCount
Keeps track of the number of train/test batches processed
|
protected boolean |
m_streaming
True if we're streaming
|
protected Filter |
m_streamingFilter
Used when processing streaming data
|
protected boolean |
m_stringAttsPresent
True if string attributes are present in streaming case
|
protected java.util.Map<java.lang.Integer,Instances> |
m_waitingTestData
Map of waiting test sets when batch filtering
|
m_defaultIconPath, m_defaultPackageIconPath, m_iconPath, m_wrappedAlgorithmm_stepIsResourceIntensive, m_stepManager, m_stepName| Constructor and Description |
|---|
Filter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkPendingStreaming()
Check to see if there are any pending instances to output from the filter
|
Filter |
getFilter()
Get the filter.
|
java.util.List<java.lang.String> |
getIncomingConnectionTypes()
Get a list of incoming connection types that this step can accept.
|
java.util.List<java.lang.String> |
getOutgoingConnectionTypes()
Get a list of outgoing connection types that this step can produce.
|
java.lang.Class |
getWrappedAlgorithmClass()
Get the class of the wrapped algorithm
|
Instances |
outputStructureForConnectionType(java.lang.String connectionName)
If possible, get the output structure for the named connection type as a
header-only set of instances.
|
protected void |
processBatch(Instances batch,
java.lang.String conType,
Filter filterToUse,
java.lang.Integer setNum,
java.lang.Integer maxSetNum)
Process a batch of instances with a supplied filter
|
protected void |
processFirstBatch(Instances batch,
java.lang.String conType,
java.lang.Integer setNum,
java.lang.Integer maxSetNum)
Processes the first batch of instances via the filter
|
void |
processIncoming(Data data)
Process an incoming data payload (if the step accepts incoming connections)
|
protected void |
processStreaming(Data data)
Process an instance
|
protected void |
processSubsequentBatch(Instances batch,
java.lang.String conType,
java.lang.Integer setNum,
java.lang.Integer maxSetNum)
Processes batches of instances that occur after the first batch
|
void |
setFilter(Filter filter)
Set the filter.
|
void |
setWrappedAlgorithm(java.lang.Object algo)
Set the wrapped algorithm (filter)
|
void |
stepInit()
Initialize the step.
|
getDefaultIconPath, getDefaultPackageLevelIconPath, getIconPath, getWrappedAlgorithm, globalInfoenvironmentSubstitute, getCustomEditorForStep, getDefaultSettings, getInteractiveViewers, getInteractiveViewersImpls, getName, getStepManager, isResourceIntensive, isStopRequested, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, start, stepMustRunSingleThreaded, stopprotected Filter m_filterTemplate
protected Filter m_streamingFilter
protected boolean m_isReset
protected boolean m_streaming
protected boolean m_stringAttsPresent
protected java.util.Map<java.lang.Integer,Filter> m_filterMap
protected java.util.Map<java.lang.Integer,Instances> m_waitingTestData
protected Data m_incrementalData
protected java.util.concurrent.atomic.AtomicInteger m_setCount
public java.lang.Class getWrappedAlgorithmClass()
getWrappedAlgorithmClass in class WekaAlgorithmWrapperpublic void setWrappedAlgorithm(java.lang.Object algo)
setWrappedAlgorithm in class WekaAlgorithmWrapperalgo - the algorithm to wrap@ProgrammaticProperty public void setFilter(Filter filter)
setWrappedAlgorithm()filter - the filter to usepublic Filter getFilter()
getWrappedAlgorithm()public java.util.List<java.lang.String> getIncomingConnectionTypes()
public java.util.List<java.lang.String> getOutgoingConnectionTypes()
public void stepInit()
throws WekaException
WekaException - if a problem occurs during initializationpublic void processIncoming(Data data) throws WekaException
processIncoming in interface BaseStepExtenderprocessIncoming in interface StepprocessIncoming in class BaseStepdata - the payload to processWekaException - if a problem occursprotected void processFirstBatch(Instances batch, java.lang.String conType, java.lang.Integer setNum, java.lang.Integer maxSetNum) throws WekaException
batch - the batch of instances processconType - the connection typesetNum - the set number of this batchmaxSetNum - the maximum set numberWekaException - if a problem occursprotected void processSubsequentBatch(Instances batch, java.lang.String conType, java.lang.Integer setNum, java.lang.Integer maxSetNum) throws WekaException
batch - the batch of instances to processconType - the connection typesetNum - the set number of this batchmaxSetNum - the maximum set numberWekaException - if a problem occursprotected void processBatch(Instances batch, java.lang.String conType, Filter filterToUse, java.lang.Integer setNum, java.lang.Integer maxSetNum) throws WekaException
batch - the batch to processconType - the connection typefilterToUse - the filter to applysetNum - the set numbermaxSetNum - the maximum set numberWekaException - if a problem occursprotected void processStreaming(Data data) throws WekaException
data - the Data object containing the instanceWekaException - if a problem occursprotected void checkPendingStreaming()
throws WekaException
WekaException - if a problem occurspublic Instances outputStructureForConnectionType(java.lang.String connectionName) throws WekaException
outputStructureForConnectionType in interface StepoutputStructureForConnectionType in class BaseStepconnectionName - the name of the connection type to get the output
structure forWekaException - if a problem occurs