public class SampleBatchByteDataSource extends Object implements DataSource<byte[]>
Constructor and Description |
---|
SampleBatchByteDataSource(List<SampleBatch> batches)
Construct with batches
|
Modifier and Type | Method and Description |
---|---|
byte[][] |
createTemporaryArray(int size)
Create a temporary array suitable for use with the
DataSource.getRandomRows(Object[]) and DataSource.getData(int, int, Object[])
methods. |
byte[] |
getData(int row)
Get the data for a given row
|
void |
getData(int startRow,
int stopRow,
byte[][] output)
Get data between given rows.
|
void |
getRandomRows(byte[][] output) |
Iterator<byte[]> |
iterator() |
int |
numDimensions() |
void |
setSeed(long seed)
Set the random seed
|
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public SampleBatchByteDataSource(List<SampleBatch> batches) throws IOException
batches
- IOException
public void setSeed(long seed)
seed
- public void getData(int startRow, int stopRow, byte[][] output)
DataSource
DataSource.size()
.
data is guaranteed to have (stopRow - startRow) valid entriesgetData
in interface DataSource<byte[]>
startRow
- where to start (inclusive)stopRow
- where to stop (exclusive)output
- the array to fillpublic void getRandomRows(byte[][] output)
getRandomRows
in interface DataSource<byte[]>
output
- a random set of data. This array is guaranteed to be filled.public int numDimensions()
numDimensions
in interface DataSource<byte[]>
public int size()
size
in interface DataSource<byte[]>
public byte[] getData(int row)
DataSource
getData
in interface DataSource<byte[]>
row
- the row numberpublic byte[][] createTemporaryArray(int size)
DataSource
DataSource.getRandomRows(Object[])
and DataSource.getData(int, int, Object[])
methods.createTemporaryArray
in interface DataSource<byte[]>
size
- the size of the array