org.neuroph.core.data
Class BufferedDataSet
- java.lang.Object
-
- org.neuroph.core.data.DataSet
-
- org.neuroph.core.data.BufferedDataSet
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Iterable<DataSetRow>, java.util.Collection<DataSetRow>, java.util.Iterator<DataSetRow>, java.util.List<DataSetRow>
public class BufferedDataSet extends DataSet implements java.util.Iterator<DataSetRow>
This class can be used for large training sets, which are partialy read from file during the training. It loads bufferSize rows from file into DataSet, and when it iterates all of them, it takes next bufferSize rows. It can be used everywhere where DataSet class is used since it extends it. The rows should be iterated with iterator() interface.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description BufferedDataSet(java.io.File file, int inputSize, int outputSize, java.lang.String delimiter)Creates new buffered data set with specified file, input and output size.BufferedDataSet(java.io.File file, int inputSize, java.lang.String delimiter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanhasNext()Returns true if there are more rows, false otherwisejava.util.Iterator<DataSetRow>iterator()Returns iterator for buffered data setDataSetRownext()Returns next data set row.voidremove()-
Methods inherited from class org.neuroph.core.data.DataSet
add, add, addAll, addAll, addRow, addRow, addRow, clear, contains, containsAll, createFromFile, createFromFile, createTrainingAndTestSubsets, get, getColumnName, getColumnNames, getColumnType, getColumnTypes, getFilePath, getInputSize, getLabel, getOutputSize, getRowAt, getRows, indexOf, isEmpty, isSupervised, lastIndexOf, listIterator, listIterator, load, remove, remove, removeAll, removeRowAt, retainAll, sample, save, save, saveAsTxt, set, setColumnName, setColumnNames, setColumnType, setFilePath, setLabel, shuffle, size, split, subList, toArray, toArray, toCSV, toString
-
-
-
-
Constructor Detail
-
BufferedDataSet
public BufferedDataSet(java.io.File file, int inputSize, java.lang.String delimiter)
-
BufferedDataSet
public BufferedDataSet(java.io.File file, int inputSize, int outputSize, java.lang.String delimiter) throws java.io.FileNotFoundExceptionCreates new buffered data set with specified file, input and output size. Data set file is assumed to be txt value with data set rows in a single line, with input and output vector values delimited by delimiter.- Parameters:
file- datas et fileinputSize- size of input vectoroutputSize- size of outut vectordelimiter- delimiter for vector values- Throws:
java.io.FileNotFoundException
-
-
Method Detail
-
iterator
public java.util.Iterator<DataSetRow> iterator()
Returns iterator for buffered data set- Specified by:
iteratorin interfacejava.lang.Iterable<DataSetRow>- Specified by:
iteratorin interfacejava.util.Collection<DataSetRow>- Specified by:
iteratorin interfacejava.util.List<DataSetRow>- Overrides:
iteratorin classDataSet- Returns:
-
hasNext
public boolean hasNext()
Returns true if there are more rows, false otherwise- Specified by:
hasNextin interfacejava.util.Iterator<DataSetRow>- Returns:
- true if there are more rows, false otherwise
-
next
public DataSetRow next()
Returns next data set row. Note that if there are no more buffered rows, this mthod will load next bufferSize rows into buffer.- Specified by:
nextin interfacejava.util.Iterator<DataSetRow>- Returns:
- next data set row
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<DataSetRow>
-
-
DMelt 3.0 © DataMelt by jWork.ORG