Package org.tribuo.datasource
Class ListDataSource<T extends Output<T>>
java.lang.Object
org.tribuo.datasource.ListDataSource<T>
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.provenance.Provenancable<DataSourceProvenance>
,Iterable<Example<T>>
,DataSource<T>
A data source which wraps up a list of
Example
s
along with their DataSourceProvenance
and an OutputFactory
.
Used for machine generated data, or some other place where it's difficult to write a specific data source.
-
Constructor Summary
ConstructorDescriptionListDataSource
(List<Example<T>> list, OutputFactory<T> factory, DataSourceProvenance provenance) Constructs an in-memory data source wrapping the supplied examples. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ListDataSource
public ListDataSource(List<Example<T>> list, OutputFactory<T> factory, DataSourceProvenance provenance) Constructs an in-memory data source wrapping the supplied examples.- Parameters:
list
- The examples.factory
- The output factory.provenance
- The data source provenance.
-
-
Method Details
-
size
public int size()Number of examples.- Returns:
- The number of examples.
-
getOutputFactory
Description copied from interface:DataSource
Returns the OutputFactory associated with this Output subclass.- Specified by:
getOutputFactory
in interfaceDataSource<T extends Output<T>>
- Returns:
- The output factory.
-
getProvenance
-
iterator
-
toString
-