@KFStep(name="PredictionAppender", category="Evaluation", toolTipText="Append predictions from classifiers or clusterers to incoming data ", iconPath="weka/gui/knowledgeflow/icons/PredictionAppender.gif") public class PredictionAppender extends BaseStep
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
m_appendProbabilities
True if probabilities are to be appended
|
protected Data |
m_instanceData
Re-usable Data object for streaming output
|
protected Instances |
m_streamingOutputStructure
Holds structure of streaming output
|
protected java.util.List<java.lang.Integer> |
m_stringAttIndexes
Keep track of indexes of string attributes in the streaming case
|
m_stepIsResourceIntensive, m_stepManager, m_stepName| Constructor and Description |
|---|
PredictionAppender() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getAppendProbabilities()
Get whether to append probability distributions rather than predicted
classes
|
java.util.List<java.lang.String> |
getIncomingConnectionTypes()
Get the incoming connection types that this step accepts
|
java.util.List<java.lang.String> |
getOutgoingConnectionTypes()
Get a list of outgoing connection types that this step can produce at this
time
|
protected Instances |
makeOutputDataClassifier(Instances inputData,
Classifier classifier,
boolean distribution,
java.lang.String relationNameModifier)
Make an output dataset for a classifier.
|
protected Instances |
makeOutputDataClusterer(Instances inputData,
Clusterer clusterer,
boolean distribution,
java.lang.String relationNameModifier)
Make an output dataset for a clusterer.
|
protected void |
predictLabelClassifier(Classifier classifier,
Instance inst,
Instance instOrig)
Add a label to an instance using a classifier
|
protected void |
predictLabelClusterer(Clusterer clusterer,
Instance inst,
Instance instOrig)
Add a cluster label to an instance using a clusterer
|
protected void |
predictProbabilitiesClassifier(Classifier classifier,
Instance inst,
Instance instOrig)
Add a distribution over class labels to an instance using a classifier
|
protected void |
predictProbabilitiesClusterer(DensityBasedClusterer clusterer,
Instance inst,
Instance instOrig)
Add a distribution over cluster labels to an instance using a
DensityBasedClusterer
|
protected void |
processBatchClassifierCase(Data data,
Instances trainingData,
Instances testData)
Process a batch classifier
|
protected void |
processBatchClustererCase(Data data,
Instances trainingData,
Instances testData)
Process a batch classifier
|
void |
processIncoming(Data data)
Process incoming data
|
protected void |
processIncrementalClassifier(Data data,
Instance inst)
Process an incremental classifier
|
void |
setAppendProbabilities(boolean append)
Set whether to append probability distributions rather than predicted
classes
|
void |
stepInit()
Initialize the step
|
environmentSubstitute, getCustomEditorForStep, getDefaultSettings, getInteractiveViewers, getInteractiveViewersImpls, getName, getStepManager, globalInfo, isResourceIntensive, isStopRequested, outputStructureForConnectionType, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, start, stepMustRunSingleThreaded, stopprotected boolean m_appendProbabilities
protected Instances m_streamingOutputStructure
protected Data m_instanceData
protected java.util.List<java.lang.Integer> m_stringAttIndexes
public void stepInit()
throws WekaException
WekaException - if a problem occurspublic java.util.List<java.lang.String> getIncomingConnectionTypes()
public java.util.List<java.lang.String> getOutgoingConnectionTypes()
public void processIncoming(Data data) throws WekaException
processIncoming in interface BaseStepExtenderprocessIncoming in interface StepprocessIncoming in class BaseStepdata - the Data object to processWekaException - if a problem occursprotected void processIncrementalClassifier(Data data, Instance inst) throws WekaException
data - the Data object to processinst - the instance to processWekaException - if a problem occursprotected void processBatchClustererCase(Data data, Instances trainingData, Instances testData) throws WekaException
data - the Data object to processtrainingData - the training data (can be null)testData - the test data (can be null)WekaException - if a problem occursprotected void processBatchClassifierCase(Data data, Instances trainingData, Instances testData) throws WekaException
data - the Data object to processtrainingData - the training data (can be null)testData - the test data (can be null)WekaException - if a problem occursprotected void predictLabelClusterer(Clusterer clusterer, Instance inst, Instance instOrig) throws WekaException
clusterer - the clusterer to useinst - the instance to append a prediction toinstOrig - the original instanceWekaException - if a problem occursprotected void predictProbabilitiesClusterer(DensityBasedClusterer clusterer, Instance inst, Instance instOrig) throws WekaException
clusterer - the clusterer to useinst - the instance to append a prediction toinstOrig - the original instanceWekaException - if a problem occursprotected void predictLabelClassifier(Classifier classifier, Instance inst, Instance instOrig) throws WekaException
classifier - the classifier to useinst - the instance to append prediction toinstOrig - the original instanceWekaException - if a problem occursprotected void predictProbabilitiesClassifier(Classifier classifier, Instance inst, Instance instOrig) throws WekaException
classifier - the classifier to useinst - the instance to append prediction toinstOrig - the original instanceWekaException - if a problem occursprotected Instances makeOutputDataClusterer(Instances inputData, Clusterer clusterer, boolean distribution, java.lang.String relationNameModifier) throws java.lang.Exception
inputData - the incoming dataclusterer - the clustererdistribution - true if a distribution over cluster labels will be
predictedrelationNameModifier - modifier to add to the incoming relation namejava.lang.Exception - if a problem occursprotected Instances makeOutputDataClassifier(Instances inputData, Classifier classifier, boolean distribution, java.lang.String relationNameModifier) throws java.lang.Exception
inputData - the incoming dataclassifier - the classifierdistribution - true if a distribution over class labels will be
predictedrelationNameModifier - modifier to add to the incoming relation namejava.lang.Exception - if a problem occurspublic void setAppendProbabilities(boolean append)
append - true to append probability distributions@OptionMetadata(displayName="Append probabilities", description="Append probabilities") public boolean getAppendProbabilities()