Class Subcontext


  • public class Subcontext
    extends java.lang.Object
    Represents a subcontext, containing a list of Instances which belong to it, along with their shared Label and common outcome. If the contained instances do not have the same outcome, then the outcome is set to AMUtils.NONDETERMINISTIC.
    • Constructor Summary

      Constructors 
      Constructor Description
      Subcontext​(Label label, java.lang.String displayLabel)
      Initializes the subcontext by creating a list to hold the data
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(weka.core.Instance e)
      Adds an exemplar e to the subcontext and sets the outcome accordingly.
      boolean equals​(java.lang.Object other)
      Two Subcontexts are considered equal if they have the same label and contain the same instances.
      java.lang.String getDisplayLabel()  
      java.util.Set<weka.core.Instance> getExemplars()  
      Label getLabel()  
      double getOutcome()  
      int hashCode()  
      boolean isNondeterministic()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Subcontext

        public Subcontext​(Label label,
                          java.lang.String displayLabel)
        Initializes the subcontext by creating a list to hold the data
        Parameters:
        label - Binary label of the subcontext
        displayLabel - user-friendly label string Labeler.getContextString(Label)
    • Method Detail

      • add

        public void add​(weka.core.Instance e)
        Adds an exemplar e to the subcontext and sets the outcome accordingly. If different outcomes are present in the contained exemplars, the outcome is AMUtils.NONDETERMINISTIC
      • getOutcome

        public double getOutcome()
      • getLabel

        public Label getLabel()
        Returns:
        Binary label of of this subcontext
      • getExemplars

        public java.util.Set<weka.core.Instance> getExemplars()
        Returns:
        list of Exemplars contained in this subcontext
      • equals

        public boolean equals​(java.lang.Object other)
        Two Subcontexts are considered equal if they have the same label and contain the same instances.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isNondeterministic

        public boolean isNondeterministic()