Package weka.classifiers.lazy.AM.data
Class Subcontext
- java.lang.Object
-
- weka.classifiers.lazy.AM.data.Subcontext
-
public class Subcontext extends java.lang.ObjectRepresents a subcontext, containing a list ofInstanceswhich belong to it, along with their sharedLabeland common outcome. If the contained instances do not have the same outcome, then the outcome is set toAMUtils.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 voidadd(weka.core.Instance e)Adds an exemplareto the subcontext and sets the outcome accordingly.booleanequals(java.lang.Object other)Two Subcontexts are considered equal if they have the same label and contain the same instances.java.lang.StringgetDisplayLabel()java.util.Set<weka.core.Instance>getExemplars()LabelgetLabel()doublegetOutcome()inthashCode()booleanisNondeterministic()java.lang.StringtoString()
-
-
-
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 subcontextdisplayLabel- user-friendly label stringLabeler.getContextString(Label)
-
-
Method Detail
-
add
public void add(weka.core.Instance e)
Adds an exemplareto the subcontext and sets the outcome accordingly. If different outcomes are present in the contained exemplars, the outcome isAMUtils.NONDETERMINISTIC
-
getOutcome
public double getOutcome()
-
getLabel
public Label getLabel()
- Returns:
- Binary label of of this subcontext
-
getDisplayLabel
public java.lang.String getDisplayLabel()
- Returns:
- User-friendly label string
- See Also:
Labeler.getContextString(Label)
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isNondeterministic
public boolean isNondeterministic()
-
-