weka.knowledgeflow.steps

## Class ModelPerformanceChart

- java.lang.Object
- - weka.knowledgeflow.steps.BaseStep
  - - weka.knowledgeflow.steps.ModelPerformanceChart

- All Implemented Interfaces:
    java.io.Serializable, BaseStepExtender, DataCollector, Step

      @KFStep(name="ModelPerformanceChart",
              category="Visualization",
              toolTipText="Visualize performance charts (such as ROC).",
              iconPath="weka/gui/knowledgeflow/icons/ModelPerformanceChart.gif")
      public class ModelPerformanceChart
      extends BaseStep
      implements DataCollector

  A Step that collects and displays either classifier error plots or threshold curves
  Version:
    $Revision: $
  Author:
    Mark Hall (mhall{[at]}pentaho{[dot]}com)
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ModelPerformanceChart()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearPlotData()` Clear all plot data (both onscreen and offscreen)
    `java.lang.String` | `getCustomEditorForStep()` Return the fully qualified name of a custom editor component (JComponent) to use for editing the properties of the step.
    `java.util.List<java.lang.String>` | `getIncomingConnectionTypes()` Get a list of incoming connection types that this step can accept.
    `java.util.Map<java.lang.String,java.lang.String>` | `getInteractiveViewers()` When running in a graphical execution environment a step can make one or more popup Viewer components available.
    `java.lang.String` | `getOffscreenAdditionalOpts()` Get the additional options for the offscreen renderer
    `java.lang.String` | `getOffscreenHeight()` Get the height (in pixels) of the offscreen image to generate
    `java.lang.String` | `getOffscreenRendererName()` Get the name of the renderer to use for offscreen chart rendering operations
    `java.lang.String` | `getOffscreenWidth()` Get the width (in pixels) of the offscreen image to generate.
    `java.lang.String` | `getOffscreenXAxis()` Get the name of the attribute for the x-axis in offscreen plots
    `java.lang.String` | `getOffscreenYAxis()` Get the name of the attribute for the y-axix of offscreen plots.
    `java.util.List<java.lang.String>` | `getOutgoingConnectionTypes()` Get a list of outgoing connection types that this step can produce.
    `java.util.List<PlotData2D>` | `getPlots()` Get the plots currently stored in this step
    `boolean` | `isDataIsThresholdData()` Returns true if the plots being stored are threshold plots
    `void` | `processIncoming(Data data)` Process incoming data
    `void` | `restoreData(java.lang.Object data)` Restore the data (plots) for this step
    `java.lang.Object` | `retrieveData()` Retrieve the data (plots) stored in this step
    `void` | `setOffscreenAdditionalOpts(java.lang.String additional)` Set the additional options for the offscreen renderer
    `void` | `setOffscreenHeight(java.lang.String height)` Set the height (in pixels) of the offscreen image to generate
    `void` | `setOffscreenRendererName(java.lang.String rendererName)` Set the name of the renderer to use for offscreen chart rendering operations
    `void` | `setOffscreenWidth(java.lang.String width)` Set the width (in pixels) of the offscreen image to generate.
    `void` | `setOffscreenXAxis(java.lang.String xAxis)` Set the name of the attribute for the x-axis in offscreen plots.
    `void` | `setOffscreenYAxis(java.lang.String yAxis)` Set the name of the attribute for the y-axis in offscreen plots.
    `void` | `stepInit()` Initialize the step

    - ### Methods inherited from class weka.knowledgeflow.steps.BaseStep

      `environmentSubstitute, getDefaultSettings, getInteractiveViewersImpls, getName, getStepManager, globalInfo, isResourceIntensive, isStopRequested, outputStructureForConnectionType, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, start, stepMustRunSingleThreaded, stop`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ModelPerformanceChart

          public ModelPerformanceChart()

  - ### Method Detail

    - #### setOffscreenXAxis

          @OptionMetadata(displayName="X-axis attribute",
                          description="Attribute name or /first, /last or /<index>",
                          displayOrder=1)
          public void setOffscreenXAxis(java.lang.String xAxis)

      Set the name of the attribute for the x-axis in offscreen plots. This defaults to "False Positive Rate" for threshold curves if not specified.
      Parameters:
        `xAxis` - the name of the xAxis

    - #### getOffscreenXAxis

          public java.lang.String getOffscreenXAxis()

      Get the name of the attribute for the x-axis in offscreen plots
      Returns:
        the name of the xAxis

    - #### setOffscreenYAxis

          @OptionMetadata(displayName="Y-axis attribute",
                          description="Attribute name or /first, /last or /<index>",
                          displayOrder=2)
          public void setOffscreenYAxis(java.lang.String yAxis)

      Set the name of the attribute for the y-axis in offscreen plots. This defaults to "True Positive Rate" for threshold curves if not specified.
      Parameters:
        `yAxis` - the name of the xAxis

    - #### getOffscreenYAxis

          public java.lang.String getOffscreenYAxis()

      Get the name of the attribute for the y-axix of offscreen plots.
      Returns:
        the name of the yAxis.

    - #### setOffscreenWidth

          @OptionMetadata(displayName="Chart width (pixels)",
                          description="Width of the rendered chart",
                          displayOrder=3)
          public void setOffscreenWidth(java.lang.String width)

      Set the width (in pixels) of the offscreen image to generate.
      Parameters:
        `width` - the width in pixels.

    - #### getOffscreenWidth

          public java.lang.String getOffscreenWidth()

      Get the width (in pixels) of the offscreen image to generate.
      Returns:
        the width in pixels.

    - #### setOffscreenHeight

          @OptionMetadata(displayName="Chart height (pixels)",
                          description="Height of the rendered chart",
                          displayOrder=4)
          public void setOffscreenHeight(java.lang.String height)

      Set the height (in pixels) of the offscreen image to generate
      Parameters:
        `height` - the height in pixels

    - #### getOffscreenHeight

          public java.lang.String getOffscreenHeight()

      Get the height (in pixels) of the offscreen image to generate
      Returns:
        the height in pixels

    - #### setOffscreenRendererName

          @ProgrammaticProperty
          public void setOffscreenRendererName(java.lang.String rendererName)

      Set the name of the renderer to use for offscreen chart rendering operations
      Parameters:
        `rendererName` - the name of the renderer to use

    - #### getOffscreenRendererName

          public java.lang.String getOffscreenRendererName()

      Get the name of the renderer to use for offscreen chart rendering operations
      Returns:
        the name of the renderer to use

    - #### setOffscreenAdditionalOpts

          @ProgrammaticProperty
          public void setOffscreenAdditionalOpts(java.lang.String additional)

      Set the additional options for the offscreen renderer
      Parameters:
        `additional` - additional options

    - #### getOffscreenAdditionalOpts

          public java.lang.String getOffscreenAdditionalOpts()

      Get the additional options for the offscreen renderer
      Returns:
        the additional options

    - #### getIncomingConnectionTypes

          public java.util.List<java.lang.String> getIncomingConnectionTypes()

      Get a list of incoming connection types that this step can accept. Ideally (and if appropriate), this should take into account the state of the step and any existing incoming connections. E.g. a step might be able to accept one (and only one) incoming batch data connection.
      Specified by:
        `getIncomingConnectionTypes` in interface `BaseStepExtender`
      Specified by:
        `getIncomingConnectionTypes` in interface `Step`
      Returns:
        a list of incoming connections that this step can accept given its current state

    - #### getOutgoingConnectionTypes

          public java.util.List<java.lang.String> getOutgoingConnectionTypes()

      Get a list of outgoing connection types that this step can produce. Ideally (and if appropriate), this should take into account the state of the step and the incoming connections. E.g. depending on what incoming connection is present, a step might be able to produce a trainingSet output, a testSet output or neither, but not both.
      Specified by:
        `getOutgoingConnectionTypes` in interface `BaseStepExtender`
      Specified by:
        `getOutgoingConnectionTypes` in interface `Step`
      Returns:
        a list of outgoing connections that this step can produce

    - #### processIncoming

          public void processIncoming(Data data)
                               throws WekaException

      Process incoming data
      Specified by:
        `processIncoming` in interface `BaseStepExtender`
      Specified by:
        `processIncoming` in interface `Step`
      Overrides:
        `processIncoming` in class `BaseStep`
      Parameters:
        `data` - the data to process
      Throws:
        `WekaException` - if a problem occurs

    - #### getInteractiveViewers

          public java.util.Map<java.lang.String,java.lang.String> getInteractiveViewers()

      When running in a graphical execution environment a step can make one or more popup Viewer components available. These might be used to display results, graphics etc. Returning null indicates that the step has no such additional graphical views. The map returned by this method should be keyed by action name (e.g. "View results"), and values should be fully qualified names of the corresponding StepInteractiveView implementation. Furthermore, the contents of this map can (and should) be dependent on whether a particular viewer should be made available - i.e. if execution hasn't occurred yet, or if a particular incoming connection type is not present, then it might not be possible to view certain results. Viewers can implement StepInteractiveView directly (in which case they need to extends JPanel), or extends the AbstractInteractiveViewer class. The later extends JPanel, uses a BorderLayout, provides a "Close" button and a method to add additional buttons.
      Specified by:
        `getInteractiveViewers` in interface `Step`
      Overrides:
        `getInteractiveViewers` in class `BaseStep`
      Returns:
        a map of viewer component names, or null if this step has no graphical views

    - #### getPlots

          public java.util.List<PlotData2D> getPlots()

      Get the plots currently stored in this step
      Returns:

    - #### isDataIsThresholdData

          public boolean isDataIsThresholdData()

      Returns true if the plots being stored are threshold plots
      Returns:
        true if the plots are threshold plots

    - #### clearPlotData

          public void clearPlotData()

      Clear all plot data (both onscreen and offscreen)

    - #### retrieveData

          public java.lang.Object retrieveData()

      Retrieve the data (plots) stored in this step
      Specified by:
        `retrieveData` in interface `DataCollector`
      Returns:
        the data stored in this step

    - #### restoreData

          public void restoreData(java.lang.Object data)
                           throws WekaException

      Restore the data (plots) for this step
      Specified by:
        `restoreData` in interface `DataCollector`
      Parameters:
        `data` - the data to set
      Throws:
        `WekaException` - if a problem occurs

    - #### stepInit

          public void stepInit()
                        throws WekaException

      Initialize the step
      Specified by:
        `stepInit` in interface `BaseStepExtender`
      Specified by:
        `stepInit` in interface `Step`
      Throws:
        `WekaException` - if a problem occurs during initialization

    - #### getCustomEditorForStep

          public java.lang.String getCustomEditorForStep()

      Return the fully qualified name of a custom editor component (JComponent) to use for editing the properties of the step. This method can return null, in which case the system will dynamically generate an editor using the GenericObjectEditor
      Specified by:
        `getCustomEditorForStep` in interface `Step`
      Overrides:
        `getCustomEditorForStep` in class `BaseStep`
      Returns:
        the fully qualified name of a step editor component