|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.cmu.minorthird.classify.sequential.MutableCandidateSegmentGroup
public class MutableCandidateSegmentGroup
A group of sliding windows associated with a sequence.
In more detail: just as a SequenceDataset holds a set of Example[] objects, a SegmentDataset holds a set of CandidateSegmentGroup objects. Each CandidateSegmentGroup is derived from a sequence of source objects s1....sN. The CandidateSegmentGroup holds an instance for each subsequence of up to K adjacent source objects (the subsequence is called a segment, or a sliding window). Here K is the "maxWindowSize", and N is the "sequenceLength".
To illustrate, suppose the original sequence is a,b,c,d,e and K=3. Then the sliding window will hold instances created from these subsequences: a,b,c,d,e,ab,bc,cd,de,abc,bcd,cde.
Constructor Summary | |
---|---|
MutableCandidateSegmentGroup(int maxWindowSize,
int sequenceLength)
Creates a new holder for sliding-window instances. |
Method Summary | |
---|---|
java.util.Set<java.lang.String> |
classNameSet()
Return the set of strings associated with ClassLabels on any of the stored segments. |
int |
getMaxWindowSize()
Return the maximum segment length. |
int |
getSequenceLength()
Return the length of the original sequence that the segments were derived from. |
java.lang.String |
getSubpopulationId()
Return the subpopulationId for the original sequence. |
Example |
getSubsequenceExample(int start,
int end)
Return the example corresponding to the segment from positions start..end |
Instance |
getSubsequenceInstance(int start,
int end)
Return the instance corresponding to the segment from positions start...end. |
ClassLabel |
getSubsequenceLabel(int start,
int end)
Return the class label associated with getSubsequenceExample(start,end). |
void |
setSubsequence(int start,
int end,
Instance newInstance)
Specify the Instance associated with positions start...end. |
void |
setSubsequence(int start,
int end,
Instance newInstance,
ClassLabel newLabel)
Specify the Instance associated with positions start...end, and associate the label with that Instance. |
int |
size()
Number of instances stored. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MutableCandidateSegmentGroup(int maxWindowSize, int sequenceLength)
maxWindowSize
- the maximum length of any sliding windowsequenceLength
- the length of the original sequenceMethod Detail |
---|
public void setSubsequence(int start, int end, Instance newInstance, ClassLabel newLabel)
start
- starting position of segment in the original
sequence from which newInstance was derived.end
- ending position, using Java conventions--e.g., start=2 and end=3 is a
segment containing one element, which had index 2 in the original sequence.public void setSubsequence(int start, int end, Instance newInstance)
public Example getSubsequenceExample(int start, int end)
CandidateSegmentGroup
getSubsequenceExample
in interface CandidateSegmentGroup
public ClassLabel getSubsequenceLabel(int start, int end)
getSubsequenceLabel
in interface CandidateSegmentGroup
public Instance getSubsequenceInstance(int start, int end)
getSubsequenceInstance
in interface CandidateSegmentGroup
public int getSequenceLength()
CandidateSegmentGroup
getSequenceLength
in interface CandidateSegmentGroup
public int getMaxWindowSize()
CandidateSegmentGroup
getMaxWindowSize
in interface CandidateSegmentGroup
public java.lang.String getSubpopulationId()
CandidateSegmentGroup
getSubpopulationId
in interface HasSubpopulationId
getSubpopulationId
in interface CandidateSegmentGroup
public int size()
CandidateSegmentGroup
size
in interface CandidateSegmentGroup
public java.util.Set<java.lang.String> classNameSet()
CandidateSegmentGroup
classNameSet
in interface CandidateSegmentGroup
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |