Package org.tribuo.data.columnar
Class ColumnarDataSource<T extends Output<T>>
java.lang.Object
org.tribuo.data.columnar.ColumnarDataSource<T>
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<DataSourceProvenance>
,Iterable<Example<T>>
,ConfigurableDataSource<T>
,DataSource<T>
- Direct Known Subclasses:
CSVDataSource
,JsonDataSource
,SQLDataSource
public abstract class ColumnarDataSource<T extends Output<T>>
extends Object
implements ConfigurableDataSource<T>
A
ConfigurableDataSource
base class which takes columnar data (e.g., csv or DB table rows) and generates Example
s.-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Is an output required from each row?protected RowProcessor<T>
The RowProcessor to use. -
Constructor Summary
ModifierConstructorDescriptionprotected
For OLCUT.protected
ColumnarDataSource
(OutputFactory<T> outputFactory, RowProcessor<T> rowProcessor, boolean outputRequired) Constructs a columnar data source with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturns the metadata keys and value types that are created by this DataSource.Returns the OutputFactory associated with this Output subclass.iterator()
protected abstract ColumnarIterator
The iterator that emitsColumnarIterator.Row
objects from the underlying data source.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface com.oracle.labs.mlrg.olcut.provenance.Provenancable
getProvenance
-
Field Details
-
rowProcessor
@Config(mandatory=true, description="The row processor to use.") protected RowProcessor<T extends Output<T>> rowProcessorThe RowProcessor to use. -
outputRequired
@Config(description="Is an output required from each row?") protected boolean outputRequiredIs an output required from each row?
-
-
Constructor Details
-
ColumnarDataSource
protected ColumnarDataSource()For OLCUT. -
ColumnarDataSource
protected ColumnarDataSource(OutputFactory<T> outputFactory, RowProcessor<T> rowProcessor, boolean outputRequired) Constructs a columnar data source with the specified parameters.- Parameters:
outputFactory
- The output factory.rowProcessor
- The row processor which converts rows into examples.outputRequired
- Is an output required for each example.
-
-
Method Details
-
getMetadataTypes
Returns the metadata keys and value types that are created by this DataSource.- Returns:
- The metadata keys and value types.
-
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.
-
iterator
-
rowIterator
The iterator that emitsColumnarIterator.Row
objects from the underlying data source.- Returns:
- The row level iterator.
-