Class JsonDataSource<T extends Output<T>>
java.lang.Object
org.tribuo.data.columnar.ColumnarDataSource<T>
org.tribuo.json.JsonDataSource<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>
A
DataSource for loading data from a JSON text file
and applying FieldProcessors to it.-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.tribuo.data.columnar.ColumnarDataSource
outputRequired, rowProcessor -
Constructor Summary
ConstructorsConstructorDescriptionJsonDataSource(URI dataFile, RowProcessor<T> rowProcessor, boolean outputRequired) Creates a JsonDataSource using the specified RowProcessor to process the data.JsonDataSource(Path dataPath, RowProcessor<T> rowProcessor, boolean outputRequired) Creates a JsonDataSource using the specified RowProcessor to process the data. -
Method Summary
Modifier and TypeMethodDescriptionvoidUsed by the OLCUT configuration system, and should not be called by external code.The iterator that emitsColumnarIterator.Rowobjects from the underlying data source.toString()Methods inherited from class org.tribuo.data.columnar.ColumnarDataSource
getMetadataTypes, getOutputFactory, iteratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
JsonDataSource
Creates a JsonDataSource using the specified RowProcessor to process the data.- Parameters:
dataPath- The Path to the data file.rowProcessor- The row processor which converts a row into anExample.outputRequired- Is the output required to exist in the data file.
-
JsonDataSource
Creates a JsonDataSource using the specified RowProcessor to process the data.- Parameters:
dataFile- A URI for the data file.rowProcessor- The row processor which converts a row into anExample.outputRequired- Is the output required to exist in the data file.
-
-
Method Details
-
postConfig
public void postConfig()Used by the OLCUT configuration system, and should not be called by external code. -
toString
-
rowIterator
Description copied from class:ColumnarDataSourceThe iterator that emitsColumnarIterator.Rowobjects from the underlying data source.- Specified by:
rowIteratorin classColumnarDataSource<T extends Output<T>>- Returns:
- The row level iterator.
-
getProvenance
-