Package org.tribuo.json
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 FieldProcessor
s to it.-
Nested Class Summary
-
Field Summary
Fields inherited from class org.tribuo.data.columnar.ColumnarDataSource
outputRequired, rowProcessor
-
Constructor Summary
ConstructorDescriptionJsonDataSource
(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 TypeMethodDescriptionvoid
Used by the OLCUT configuration system, and should not be called by external code.The iterator that emitsColumnarIterator.Row
objects from the underlying data source.toString()
Methods inherited from class org.tribuo.data.columnar.ColumnarDataSource
getMetadataTypes, getOutputFactory, iterator
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
-
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:ColumnarDataSource
The iterator that emitsColumnarIterator.Row
objects from the underlying data source.- Specified by:
rowIterator
in classColumnarDataSource<T extends Output<T>>
- Returns:
- The row level iterator.
-
getProvenance
-