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 Examples.
  • Field Details

    • rowProcessor

      @Config(mandatory=true, description="The row processor to use.") protected RowProcessor<T extends Output<T>> rowProcessor
    • outputRequired

      @Config(description="Is an output required from each row?") protected boolean outputRequired
  • 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

      public Map<String,Class<?>> getMetadataTypes()
      Returns the metadata keys and value types that are created by this DataSource.
      Returns:
      The metadata keys and value types.
    • getOutputFactory

      public OutputFactory<T> getOutputFactory()
      Description copied from interface: DataSource
      Returns the OutputFactory associated with this Output subclass.
      Specified by:
      getOutputFactory in interface DataSource<T extends Output<T>>
      Returns:
      The output factory.
    • iterator

      public Iterator<Example<T>> iterator()
      Specified by:
      iterator in interface Iterable<T extends Output<T>>
    • rowIterator

      protected abstract ColumnarIterator rowIterator()
      The iterator that emits ColumnarIterator.Row objects from the underlying data source.
      Returns:
      The row level iterator.