edu.cmu.minorthird.classify.sequential
Class SegmentDataset

java.lang.Object
  extended by edu.cmu.minorthird.classify.sequential.SegmentDataset
All Implemented Interfaces:
Dataset, Visible

public class SegmentDataset
extends java.lang.Object
implements Dataset

A SequenceDataset that additionally includes examples for 'sliding windows' over the original data.

Author:
William Cohen

Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.cmu.minorthird.classify.Dataset
Dataset.Split
 
Constructor Summary
SegmentDataset()
           
 
Method Summary
 void add(Example example)
          Add an example to the dataset.
 void add(Example example, boolean compress)
          Add an Example to the dataset.
 void addCandidateSegmentGroup(CandidateSegmentGroup group)
          Add a new sequence of examples to the dataset.
 java.util.Iterator<CandidateSegmentGroup> candidateSegmentGroupIterator()
           
 FeatureFactory getFeatureFactory()
          Get the FeatureFactory associated with the dataset
 int getMaxWindowSize()
           
 int getNumberOfSegmentGroups()
           
 int getNumPosExamples()
           
 ExampleSchema getSchema()
          Get the schema associated with the dataset
protected  Dataset invertIteration(java.util.Iterator<CandidateSegmentGroup> i)
           
 java.util.Iterator<Example> iterator()
          Iterate over all examples
 void setDataCompression(boolean flag)
           
 Dataset shallowCopy()
          Make a shallow copy of the dataset.
 void shuffle()
          Randomly re-order the examples.
 void shuffle(java.util.Random r)
          Randomly re-order the examples.
 int size()
          Return the number of examples.
 Dataset.Split split(Splitter<Example> splitter)
          Partition the dataset as required by the splitter.
 Dataset.Split splitCandidateSegmentGroup(Splitter<CandidateSegmentGroup> splitter)
           
 Viewer toGUI()
          A GUI view of the dataset.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SegmentDataset

public SegmentDataset()
Method Detail

setDataCompression

public void setDataCompression(boolean flag)

getFeatureFactory

public FeatureFactory getFeatureFactory()
Description copied from interface: Dataset
Get the FeatureFactory associated with the dataset

Specified by:
getFeatureFactory in interface Dataset

getMaxWindowSize

public int getMaxWindowSize()

size

public int size()
Description copied from interface: Dataset
Return the number of examples.

Specified by:
size in interface Dataset

getNumberOfSegmentGroups

public int getNumberOfSegmentGroups()

addCandidateSegmentGroup

public void addCandidateSegmentGroup(CandidateSegmentGroup group)
Add a new sequence of examples to the dataset.


getSchema

public ExampleSchema getSchema()
Description copied from interface: Dataset
Get the schema associated with the dataset

Specified by:
getSchema in interface Dataset

add

public void add(Example example)
Add an example to the dataset.

This method compresses the example before adding it to the dataset. If you want/need the example to be compressed then call add(Example, boolean)

Specified by:
add in interface Dataset
Parameters:
example - The Example that you want to add to the dataset.

add

public void add(Example example,
                boolean compress)
Add an Example to the dataset.

This method lets the caller specify whether or not to compress the example before adding it to the dataset.

Specified by:
add in interface Dataset
Parameters:
example - The example to add to the dataset
compress - Boolean specifying whether or not to compress the example.

iterator

public java.util.Iterator<Example> iterator()
Iterate over all examples

Specified by:
iterator in interface Dataset

candidateSegmentGroupIterator

public java.util.Iterator<CandidateSegmentGroup> candidateSegmentGroupIterator()

toString

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

shuffle

public void shuffle(java.util.Random r)
Randomly re-order the examples.

Specified by:
shuffle in interface Dataset

shuffle

public void shuffle()
Randomly re-order the examples.

Specified by:
shuffle in interface Dataset

shallowCopy

public Dataset shallowCopy()
Make a shallow copy of the dataset.

Specified by:
shallowCopy in interface Dataset

split

public Dataset.Split split(Splitter<Example> splitter)
Description copied from interface: Dataset
Partition the dataset as required by the splitter.

Specified by:
split in interface Dataset

splitCandidateSegmentGroup

public Dataset.Split splitCandidateSegmentGroup(Splitter<CandidateSegmentGroup> splitter)

invertIteration

protected Dataset invertIteration(java.util.Iterator<CandidateSegmentGroup> i)

toGUI

public Viewer toGUI()
A GUI view of the dataset.

Specified by:
toGUI in interface Visible

getNumPosExamples

public int getNumPosExamples()