Package weka.classifiers.lazy.AM.data
Class Subcontext
- java.lang.Object
-
- weka.classifiers.lazy.AM.data.Subcontext
-
public class Subcontext extends java.lang.Object
Represents a subcontext, containing a list ofInstances
which belong to it, along with their sharedLabel
and 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 void
add(weka.core.Instance e)
Adds an exemplare
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()
-
-
-
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 exemplare
to 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isNondeterministic
public boolean isNondeterministic()
-
-