@KFStep(name="ClassifierPerformanceEvaluator", category="Evaluation", toolTipText="Evaluates batch classifiers", iconPath="weka/gui/knowledgeflow/icons/ClassifierPerformanceEvaluator.gif") public class ClassifierPerformanceEvaluator extends BaseStep
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ClassifierPerformanceEvaluator.AggregateableClassifierErrorsPlotInstances
Subclass of ClassifierErrorsPlotInstances to allow plot point sizes to be
scaled according to global min/max values.
|
protected class |
ClassifierPerformanceEvaluator.EvaluationCallback
Callback that gets notified when an evaluation task completes.
|
protected static class |
ClassifierPerformanceEvaluator.EvaluationTask
Class that performs the actual evaluation of a set/fold
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
m_costSensitiveEval
True to perform cost sensitive evaluation
|
protected java.lang.String |
m_costString
The cost matrix (string form)
|
protected boolean |
m_errorPlotPointSizeProportionalToMargin
True if plot point sizes are to be rendered proportional to the size of the
prediction margin
|
protected boolean |
m_isReset
True if the step has been reset
|
protected CostMatrix |
m_matrix
The cost matrix
|
protected int |
m_maxSetNum
The maximum set number in the batch of sets being processed
|
protected java.util.List<java.lang.String> |
m_metricsList
Holds a list of metric names
|
protected java.lang.String |
m_selectedEvalMetrics
Evaluation metrics to output
|
protected java.util.concurrent.atomic.AtomicInteger |
m_setsToGo
For counting down the sets left to process
|
protected java.util.concurrent.atomic.AtomicInteger |
m_taskCount |
m_stepIsResourceIntensive, m_stepManager, m_stepName| Constructor and Description |
|---|
ClassifierPerformanceEvaluator()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected static Evaluation |
adjustForInputMappedClassifier(Evaluation eval,
Classifier classifier,
Instances inst,
ClassifierErrorsPlotInstances plotInstances,
CostMatrix matrix)
Adjust evaluation configuration if an
InputMappedClassifier is
being used |
protected void |
aggregateEvalTask(Evaluation eval,
Classifier classifier,
Instances testData,
ClassifierErrorsPlotInstances plotInstances,
int setNum,
java.lang.String evalLabel)
Aggregates a single evaluation task into the overall evaluation
|
java.lang.String |
getCostMatrixString()
Get the cost matrix to use as a string
|
java.lang.String |
getCustomEditorForStep()
Return the fully qualified name of a custom editor component (JComponent)
to use for editing the properties of the step.
|
boolean |
getErrorPlotPointSizeProportionalToMargin()
Get whether the size of plot data points will be proportional to the
prediction margin
|
boolean |
getEvaluateWithRespectToCosts()
Get whether to evaluate with respoect to costs
|
java.lang.String |
getEvaluationMetricsToOutput()
Get the evaluation metrics to output (as a comma-separated list).
|
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.
|
void |
processIncoming(Data data)
Process an incoming data payload (if the step accepts incoming connections)
|
void |
setCostMatrixString(java.lang.String cms)
Set the cost matrix to use as a string
|
void |
setErrorPlotPointSizeProportionalToMargin(boolean e)
Set whether the size of plot data points will be proportional to the
prediction margin
|
void |
setEvaluateWithRespectToCosts(boolean useCosts)
Set whether to evaluate with respoect to costs
|
void |
setEvaluationMetricsToOutput(java.lang.String m)
Set the evaluation metrics to output (as a comma-separated list).
|
void |
stepInit()
Initialize the step.
|
void |
stop()
Request that processing be stopped.
|
protected void |
stringToList(java.lang.String l) |
environmentSubstitute, getDefaultSettings, getInteractiveViewers, getInteractiveViewersImpls, getName, getStepManager, globalInfo, isResourceIntensive, isStopRequested, outputStructureForConnectionType, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, start, stepMustRunSingleThreadedprotected boolean m_errorPlotPointSizeProportionalToMargin
protected boolean m_costSensitiveEval
protected java.lang.String m_costString
protected CostMatrix m_matrix
protected java.lang.String m_selectedEvalMetrics
protected java.util.List<java.lang.String> m_metricsList
protected boolean m_isReset
protected java.util.concurrent.atomic.AtomicInteger m_setsToGo
protected int m_maxSetNum
protected java.util.concurrent.atomic.AtomicInteger m_taskCount
public ClassifierPerformanceEvaluator()
protected void stringToList(java.lang.String l)
@OptionMetadata(displayName="Error plot point size proportional to margin", description="Set the point size proportional to the prediction margin for classification error plots") public boolean getErrorPlotPointSizeProportionalToMargin()
public void setErrorPlotPointSizeProportionalToMargin(boolean e)
e - true if plot data points will be rendered proportional to the size
of the prediction margin@ProgrammaticProperty public java.lang.String getEvaluationMetricsToOutput()
public void setEvaluationMetricsToOutput(java.lang.String m)
m - the evaluation metrics to output@ProgrammaticProperty public void setEvaluateWithRespectToCosts(boolean useCosts)
useCosts - true to use cost-sensitive evaluationpublic boolean getEvaluateWithRespectToCosts()
@ProgrammaticProperty public void setCostMatrixString(java.lang.String cms)
cms - the cost matrix to usepublic java.lang.String getCostMatrixString()
public java.util.List<java.lang.String> getIncomingConnectionTypes()
public java.util.List<java.lang.String> getOutgoingConnectionTypes()
public void stepInit()
throws WekaException
StepWekaException - if a problem occurs during initializationpublic void stop()
BaseStepisStopRequested() periodically to see if they should stop
processing.public 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 aggregateEvalTask(Evaluation eval, Classifier classifier, Instances testData, ClassifierErrorsPlotInstances plotInstances, int setNum, java.lang.String evalLabel) throws java.lang.Exception
eval - the partial evaluation to aggregateclassifier - the classifier used for evaluationtestData - the test data evaluated onplotInstances - plotting instancessetNum - the set number processedevalLabel - evaluation typejava.lang.Exception - if a problem occurspublic java.lang.String getCustomEditorForStep()
getCustomEditorForStep in interface StepgetCustomEditorForStep in class BaseStepprotected static Evaluation adjustForInputMappedClassifier(Evaluation eval, Classifier classifier, Instances inst, ClassifierErrorsPlotInstances plotInstances, CostMatrix matrix) throws java.lang.Exception
InputMappedClassifier is
being usedeval - the evaluation object ot adjustclassifier - the classifier being usedinst - the instances being evaluated onplotInstances - plotting instancesmatrix - the CostMatrix to use, or null for no cost-sensitive
evaluationEvaluation objectjava.lang.Exception - if a problem occurs