|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.cmu.minorthird.classify.sequential.SequenceDataset
public class SequenceDataset
A dataset of sequences of examples.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface edu.cmu.minorthird.classify.Dataset |
|---|
Dataset.Split |
| Field Summary | |
|---|---|
protected java.util.Set<java.lang.String> |
classNameSet
|
protected FeatureFactory |
factory
|
protected java.util.List<Example[]> |
sequenceList
|
protected int |
totalSize
|
| Fields inherited from interface edu.cmu.minorthird.classify.sequential.SequenceConstants |
|---|
HISTORY_FEATURE, NULL_CLASS_NAME |
| Constructor Summary | |
|---|---|
SequenceDataset()
|
|
| Method Summary | |
|---|---|
void |
add(Example example)
Add a new example to the dataset. |
void |
add(Example example,
boolean compress)
Add a new example to the dataset. |
void |
addSequence(Example[] sequence)
Add a new sequence of examples to the dataset. |
void |
addSequence(Example[] sequence,
boolean compress)
Add a new sequence of examples to the dataset This method allows the caller to specify if they want the examples to be compressed or not. |
java.lang.String |
getExtensionFor(java.lang.String s)
Recomended extension for the format with the given name. |
FeatureFactory |
getFeatureFactory()
Get the FeatureFactory associated with the dataset |
java.lang.String[] |
getFormatNames()
List of formats in which the object can be saved. |
int |
getHistorySize()
Return the current history length. |
int |
getNumPosExamples()
|
ExampleSchema |
getSchema()
Get the schema associated with the dataset |
protected Dataset |
invertIteration(java.util.Iterator<Example[]> i)
|
java.util.Iterator<Example> |
iterator()
Iterate over all examples, extended so as to contain history information. |
static void |
main(java.lang.String[] args)
|
int |
numberOfSequences()
Return the number of sequences. |
java.lang.Object |
restore(java.io.File file)
Restore the object from a file. |
void |
saveAs(java.io.File file,
java.lang.String format)
Save this object to the given file, in the given format. |
java.util.Iterator<Example[]> |
sequenceIterator()
Return an iterator over all sequences. |
void |
setHistorySize(int k)
Set the current history length. |
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 |
splitSequence(Splitter<Example[]> 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 |
| Field Detail |
|---|
protected java.util.List<Example[]> sequenceList
protected int totalSize
protected java.util.Set<java.lang.String> classNameSet
protected FeatureFactory factory
| Constructor Detail |
|---|
public SequenceDataset()
| Method Detail |
|---|
public FeatureFactory getFeatureFactory()
Dataset
getFeatureFactory in interface Datasetpublic void setHistorySize(int k)
public int getHistorySize()
public ExampleSchema getSchema()
Dataset
getSchema in interface Datasetpublic void add(Example example)
add(Example, boolean).
add in interface Datasetexample - The example to add to the dataset.
public void add(Example example,
boolean compress)
add in interface Datasetexample - The example to add to the dataset.compress - Boolean specifying whether or not to compress the example.public void addSequence(Example[] sequence)
addSequence(Example[], boolean).
public void addSequence(Example[] sequence,
boolean compress)
sequence - The sequence of examples to add to the datasetcompress - Boolean specifying whether or not to compress the examples.public java.util.Iterator<Example> iterator()
iterator in interface Datasetpublic int size()
size in interface Datasetpublic int numberOfSequences()
public java.util.Iterator<Example[]> sequenceIterator()
public void shuffle(java.util.Random r)
shuffle in interface Datasetpublic void shuffle()
shuffle in interface Datasetpublic Dataset shallowCopy()
shallowCopy in interface Datasetpublic Dataset.Split split(Splitter<Example> splitter)
Dataset
split in interface Datasetpublic Dataset.Split splitSequence(Splitter<Example[]> splitter)
protected Dataset invertIteration(java.util.Iterator<Example[]> i)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String[] getFormatNames()
Saveable
getFormatNames in interface Saveablepublic java.lang.String getExtensionFor(java.lang.String s)
Saveable
getExtensionFor in interface Saveable
public void saveAs(java.io.File file,
java.lang.String format)
throws java.io.IOException
Saveable
saveAs in interface Saveablejava.io.IOException
public java.lang.Object restore(java.io.File file)
throws java.io.IOException
Saveable
restore in interface Saveablejava.io.IOExceptionpublic Viewer toGUI()
toGUI in interface Visible
public static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOExceptionpublic int getNumPosExamples()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||