edu.cmu.minorthird.classify.sequential
Class CompactCandidateSegmentGroup

java.lang.Object
  extended by edu.cmu.minorthird.classify.sequential.CompactCandidateSegmentGroup
All Implemented Interfaces:
HasSubpopulationId, CandidateSegmentGroup, java.io.Serializable

public class CompactCandidateSegmentGroup
extends java.lang.Object
implements CandidateSegmentGroup, java.io.Serializable

A more space-efficient version of a CandidateSegmentGroup. Space is saved by explicitly storing the instances for the unit-length segments, plus "deltas" for each non-unit length segment. Each "delta" encodes the difference between the segment instance and the sum of the unit-length instances it covers.

Author:
William Cohen
See Also:
Serialized Form

Constructor Summary
CompactCandidateSegmentGroup(FeatureFactory factory, CandidateSegmentGroup group)
          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).
 int size()
          Number of instances stored.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompactCandidateSegmentGroup

public CompactCandidateSegmentGroup(FeatureFactory factory,
                                    CandidateSegmentGroup group)
Creates a new holder for sliding-window instances.

Method Detail

getSubsequenceExample

public Example getSubsequenceExample(int start,
                                     int end)
Description copied from interface: CandidateSegmentGroup
Return the example corresponding to the segment from positions start..end

Specified by:
getSubsequenceExample in interface CandidateSegmentGroup

getSubsequenceLabel

public ClassLabel getSubsequenceLabel(int start,
                                      int end)
Return the class label associated with getSubsequenceExample(start,end).

Specified by:
getSubsequenceLabel in interface CandidateSegmentGroup

getSubsequenceInstance

public Instance getSubsequenceInstance(int start,
                                       int end)
Return the instance corresponding to the segment from positions start...end.

Specified by:
getSubsequenceInstance in interface CandidateSegmentGroup

getSequenceLength

public int getSequenceLength()
Description copied from interface: CandidateSegmentGroup
Return the length of the original sequence that the segments were derived from.

Specified by:
getSequenceLength in interface CandidateSegmentGroup

getMaxWindowSize

public int getMaxWindowSize()
Description copied from interface: CandidateSegmentGroup
Return the maximum segment length.

Specified by:
getMaxWindowSize in interface CandidateSegmentGroup

getSubpopulationId

public java.lang.String getSubpopulationId()
Description copied from interface: CandidateSegmentGroup
Return the subpopulationId for the original sequence.

Specified by:
getSubpopulationId in interface HasSubpopulationId
Specified by:
getSubpopulationId in interface CandidateSegmentGroup

size

public int size()
Description copied from interface: CandidateSegmentGroup
Number of instances stored.

Specified by:
size in interface CandidateSegmentGroup

classNameSet

public java.util.Set<java.lang.String> classNameSet()
Description copied from interface: CandidateSegmentGroup
Return the set of strings associated with ClassLabels on any of the stored segments.

Specified by:
classNameSet in interface CandidateSegmentGroup