Class AttributeSummaryPanel

  • All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible

    public class AttributeSummaryPanel
    extends JPanel
    This panel displays summary statistics about an attribute: name, type number/% of missing/unique values, number of distinct values. For numeric attributes gives some other stats (mean/std dev), for nominal attributes gives counts for each attribute value. This panel refers to weka.gui.AttributeSummaryPanel.
    Author:
    Len Trigg (trigg@cs.waikato.ac.nz), Yongheng Ma (2560653665@qq.com)
    See Also:
    Serialized Form
    • Field Detail

      • NO_SOURCE

        protected static final String NO_SOURCE
        Message shown when no instances have been loaded and no attribute set
        See Also:
        Constant Field Values
      • m_AttributeNameLab

        protected JLabel m_AttributeNameLab
        Displays the name of the relation
      • m_AttributeTypeLab

        protected JLabel m_AttributeTypeLab
        Displays the type of attribute
      • m_MissingLab

        protected JLabel m_MissingLab
        Displays the number of missing values
      • m_UniqueLab

        protected JLabel m_UniqueLab
        Displays the number of unique values
      • m_DistinctLab

        protected JLabel m_DistinctLab
        Displays the number of distinct values
      • m_StatsTable

        protected JTable m_StatsTable
        Displays other stats in a table
      • m_Instances

        protected Instances m_Instances
        The instances we're playing with
      • m_AttributeStats

        protected weka.core.AttributeStats[] m_AttributeStats
        Cached stats on the attributes we've summarized so far
      • m_allEqualWeights

        protected boolean m_allEqualWeights
        Do all instances have the same weight
    • Constructor Detail

      • AttributeSummaryPanel

        public AttributeSummaryPanel()
        Creates the instances panel with no initial instances.
    • Method Detail

      • setInstances

        public void setInstances​(Instances inst)
        Tells the panel to use a new set of instances.
        Parameters:
        inst - a set of Instances
      • setAttribute

        public void setAttribute​(int index)
        Sets the attribute that statistics will be displayed for.
        Parameters:
        index - the index of the attribute to display
      • setDerived

        protected void setDerived​(int index)
        Sets the gui elements for fields that are stored in the AttributeStats structure.
        Parameters:
        index - the index of the attribute
      • setTable

        protected void setTable​(weka.core.AttributeStats as,
                                int index)
        Creates a tablemodel for the attribute being displayed
        Parameters:
        as - the attribute statistics
        index - the index of the attribute
      • setHeader

        protected void setHeader​(int index)
        Sets the labels for fields we can determine just from the instance header.
        Parameters:
        index - the index of the attribute
      • main

        public static void main​(String[] args)
        Tests out the attribute summary panel from the command line.
        Parameters:
        args - optional name of dataset to load