T
- the type of the outputs in the data set.public abstract class SequenceDataset<T extends Output<T>> extends Object implements Iterable<SequenceExample<T>>, com.oracle.labs.mlrg.olcut.provenance.Provenancable<DatasetProvenance>, Serializable
Subclass either MutableSequenceDataset
or ImmutableSequenceDataset
rather than this class.
Modifier and Type | Field and Description |
---|---|
protected List<SequenceExample<T>> |
data
The data in this data set.
|
protected OutputFactory<T> |
outputFactory
A factory for making
OutputInfo and Output of the appropriate type. |
protected DataProvenance |
sourceProvenance
The provenance of the data source, extracted on construction.
|
Modifier | Constructor and Description |
---|---|
protected |
SequenceDataset(DataProvenance sourceProvenance,
OutputFactory<T> outputFactory) |
Modifier and Type | Method and Description |
---|---|
List<SequenceExample<T>> |
getData()
Returns an unmodifiable view on the data.
|
SequenceExample<T> |
getExample(int index)
Gets the example at the specified index, or throws IllegalArgumentException if
the index is out of bounds.
|
abstract ImmutableFeatureMap |
getFeatureIDMap()
An immutable view on the feature map.
|
abstract FeatureMap |
getFeatureMap()
The feature map.
|
Dataset<T> |
getFlatDataset()
Returns a view on this SequenceDataset which aggregates all
the examples and ignores the sequence structure.
|
OutputFactory<T> |
getOutputFactory()
Gets the output factory.
|
abstract ImmutableOutputInfo<T> |
getOutputIDInfo()
An immutable view on the output info in this dataset.
|
abstract OutputInfo<T> |
getOutputInfo()
The output info in this dataset.
|
abstract Set<T> |
getOutputs()
Gets the set of labels that occur in the examples in this dataset.
|
String |
getSourceDescription()
Returns the description of the source provenance.
|
DataProvenance |
getSourceProvenance()
Returns the source provenance.
|
Iterator<SequenceExample<T>> |
iterator() |
int |
size()
Gets the size of the data set.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected final OutputFactory<T extends Output<T>> outputFactory
OutputInfo
and Output
of the appropriate type.protected final List<SequenceExample<T extends Output<T>>> data
protected final DataProvenance sourceProvenance
protected SequenceDataset(DataProvenance sourceProvenance, OutputFactory<T> outputFactory)
public String getSourceDescription()
public List<SequenceExample<T>> getData()
public DataProvenance getSourceProvenance()
public abstract Set<T> getOutputs()
public SequenceExample<T> getExample(int index)
index
- The index.public Dataset<T> getFlatDataset()
public int size()
public abstract ImmutableOutputInfo<T> getOutputIDInfo()
public abstract OutputInfo<T> getOutputInfo()
public abstract ImmutableFeatureMap getFeatureIDMap()
public abstract FeatureMap getFeatureMap()
public OutputFactory<T> getOutputFactory()
public Iterator<SequenceExample<T>> iterator()
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.