Class WekaThresholdCurve

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ClearableDisplay, DisplayTypeSupporter, ErrorHandler, InputConsumer, ComponentSupplier, DisplayPanelProvider, MenuBarProvider, SendToActionSupporter, Serializable, Comparable

    public class WekaThresholdCurve
    extends AbstractGraphicalDisplay
    implements DisplayPanelProvider
    Actor for displaying threshold curves, like ROC or precision/recall.

    Input/output:
    - accepts:
       weka.classifiers.Evaluation
       adams.flow.container.WekaEvaluationContainer


    Container information:
    - adams.flow.container.WekaEvaluationContainer: Evaluation, Model

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: WekaThresholdCurve
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
        default: false
     
    -short-title <boolean> (property: shortTitle)
        If enabled uses just the name for the title instead of the actor's full 
        name.
        default: false
     
    -width <int> (property: width)
        The width of the dialog.
        default: 640
        minimum: -1
     
    -height <int> (property: height)
        The height of the dialog.
        default: 480
        minimum: -1
     
    -x <int> (property: x)
        The X position of the dialog (>=0: absolute, -1: left, -2: center, -3: right
        ).
        default: -1
        minimum: -3
     
    -y <int> (property: y)
        The Y position of the dialog (>=0: absolute, -1: top, -2: center, -3: bottom
        ).
        default: -1
        minimum: -3
     
    -writer <adams.gui.print.JComponentWriter> (property: writer)
        The writer to use for generating the graphics output.
        default: adams.gui.print.NullWriter
     
    -index <adams.core.Range> (property: classLabelRange)
        The indices of the class labels to use for the plot.
        default: first
        example: A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 'inv(...)' inverts the range '...'; the following placeholders can be used as well: first, second, third, last_2, last_1, last
     
    -attribute-x <TRUE_POS|FALSE_NEG|FALSE_POS|TRUE_NEG|FP_RATE|TP_RATE|PRECISION|RECALL|FALLOUT|FMEASURE|SAMPLE_SIZE|LIFT|THRESHOLD> (property: attributeX)
        The attribute to show on the X axis.
        default: FP_RATE
     
    -attribute-y <TRUE_POS|FALSE_NEG|FALSE_POS|TRUE_NEG|FP_RATE|TP_RATE|PRECISION|RECALL|FALLOUT|FMEASURE|SAMPLE_SIZE|LIFT|THRESHOLD> (property: attributeY)
        The attribute to show on the Y axis.
        default: TP_RATE
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Constructor Detail

      • WekaThresholdCurve

        public WekaThresholdCurve()
    • Method Detail

      • getDefaultWidth

        protected int getDefaultWidth()
        Returns the default width for the dialog.
        Overrides:
        getDefaultWidth in class AbstractDisplay
        Returns:
        the default width
      • getDefaultHeight

        protected int getDefaultHeight()
        Returns the default height for the dialog.
        Overrides:
        getDefaultHeight in class AbstractDisplay
        Returns:
        the default height
      • setClassLabelRange

        public void setClassLabelRange​(WekaLabelRange value)
        Sets the class label indices.
        Parameters:
        value - the range
      • getClassLabelRange

        public WekaLabelRange getClassLabelRange()
        Returns the class label indices.
        Returns:
        the range
      • classLabelRangeTipText

        public String classLabelRangeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setAttributeX

        public void setAttributeX​(WekaThresholdCurve.AttributeName value)
        Sets the attribute to show on the X axis.
        Parameters:
        value - the attribute
      • attributeXTipText

        public String attributeXTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setAttributeY

        public void setAttributeY​(WekaThresholdCurve.AttributeName value)
        Sets the attribute to show on the Y axis.
        Parameters:
        value - the attribute
      • attributeYTipText

        public String attributeYTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Specified by:
        accepts in interface InputConsumer
        Returns:
        weka.classifiers.Evaluation.class, adams.flow.container.WekaEvaluationContainer.class
      • display

        protected void display​(Token token)
        Plots the token (the panel and dialog have already been created at this stage).
        Specified by:
        display in class AbstractDisplay
        Parameters:
        token - the token to display
      • getEvaluation

        protected weka.classifiers.Evaluation getEvaluation​(Token token)
        Returns the Evaluation object from the token.
        Parameters:
        token - the token to extract the Evaluation object from
        Returns:
        the Evaluation object
      • displayPanelRequiresScrollPane

        public boolean displayPanelRequiresScrollPane()
        Returns whether the created display panel requires a scroll pane or not.
        Specified by:
        displayPanelRequiresScrollPane in interface DisplayPanelProvider
        Returns:
        true if the display panel requires a scroll pane