org.encog.ml.data.basic
Class BasicMLDataSet
- java.lang.Object
-
- org.encog.ml.data.basic.BasicMLDataSet
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Iterable<MLDataPair>, MLDataSet
- Direct Known Subclasses:
- BasicNeuralDataSet, CSVNeuralDataSet, ImageMLDataSet, SQLNeuralDataSet
public class BasicMLDataSet extends java.lang.Object implements java.io.Serializable, MLDataSet
Stores data in an ArrayList. This class is memory based, so large enough datasets could cause memory issues. Many other dataset types extend this class.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classBasicMLDataSet.BasicMLIteratorAn iterator to be used with the BasicMLDataSet.
-
Constructor Summary
Constructors Constructor and Description BasicMLDataSet()Default constructor.BasicMLDataSet(double[][] input, double[][] ideal)Construct a data set from an input and ideal array.BasicMLDataSet(java.util.List<MLDataPair> theData)Construct a data set from an already created list.BasicMLDataSet(MLDataSet set)Copy whatever dataset type is specified into a memory dataset.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(MLData theData)Add a object to the dataset.voidadd(MLData inputData, MLData idealData)Add a set of input and ideal data to the dataset.voidadd(MLDataPair inputData)Add a an object to the dataset.java.lang.Objectclone()voidclose()Close this datasource and release any resources obtained by it, including any iterators created.MLDataPairget(int index)java.util.List<MLDataPair>getData()Get the data held by this container.intgetIdealSize()intgetInputSize()voidgetRecord(long index, MLDataPair pair)Read an individual record, specified by index, in random order.longgetRecordCount()Determine the total number of records in the set.booleanisSupervised()java.util.Iterator<MLDataPair>iterator()MLDataSetopenAdditional()Opens an additional instance of this dataset.voidsetData(java.util.List<MLDataPair> theData)intsize()static java.util.List<MLDataPair>toList(MLDataSet theSet)Concert the data set to a list.
-
-
-
Constructor Detail
-
BasicMLDataSet
public BasicMLDataSet()
Default constructor.
-
BasicMLDataSet
public BasicMLDataSet(double[][] input, double[][] ideal)Construct a data set from an input and ideal array.- Parameters:
input- The input into the machine learning method for training.ideal- The ideal output for training.
-
BasicMLDataSet
public BasicMLDataSet(java.util.List<MLDataPair> theData)
Construct a data set from an already created list. Mostly used to duplicate this class.- Parameters:
theData- The data to use.
-
BasicMLDataSet
public BasicMLDataSet(MLDataSet set)
Copy whatever dataset type is specified into a memory dataset.- Parameters:
set- The dataset to copy.
-
-
Method Detail
-
add
public void add(MLData theData)
Add a object to the dataset. This is used with unsupervised training, as no ideal output is provided. Note: not all implemenations support the add methods.
-
add
public void add(MLData inputData, MLData idealData)
Add a set of input and ideal data to the dataset. This is used with supervised training, as ideal output is provided. Note: not all implementations support the add methods.
-
add
public void add(MLDataPair inputData)
Add a an object to the dataset. This is used with unsupervised training, as no ideal output is provided. Note: not all implementations support the add methods.
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object
-
close
public void close()
Close this datasource and release any resources obtained by it, including any iterators created.
-
getData
public java.util.List<MLDataPair> getData()
Get the data held by this container.- Returns:
- the data
-
getIdealSize
public int getIdealSize()
- Specified by:
getIdealSizein interfaceMLDataSet- Returns:
- The size of the ideal data.
-
getInputSize
public int getInputSize()
- Specified by:
getInputSizein interfaceMLDataSet- Returns:
- The size of the input data.
-
getRecord
public void getRecord(long index, MLDataPair pair)Read an individual record, specified by index, in random order.
-
getRecordCount
public long getRecordCount()
Determine the total number of records in the set.- Specified by:
getRecordCountin interfaceMLDataSet- Returns:
- The total number of records in the set.
-
isSupervised
public boolean isSupervised()
- Specified by:
isSupervisedin interfaceMLDataSet- Returns:
- True if this is a supervised training set.
-
iterator
public java.util.Iterator<MLDataPair> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<MLDataPair>
-
openAdditional
public MLDataSet openAdditional()
Opens an additional instance of this dataset.- Specified by:
openAdditionalin interfaceMLDataSet- Returns:
- The new instance.
-
setData
public void setData(java.util.List<MLDataPair> theData)
- Parameters:
theData- the data to set
-
toList
public static java.util.List<MLDataPair> toList(MLDataSet theSet)
Concert the data set to a list.- Parameters:
theSet- The data set to convert.- Returns:
- The list.
-
get
public MLDataPair get(int index)
-
-
DMelt 3.0 © DataMelt by jWork.ORG