org.encog.ml.data.basic
Class BasicMLSequenceSet
- java.lang.Object
-
- org.encog.ml.data.basic.BasicMLSequenceSet
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Iterable<MLDataPair>, MLDataSet, MLSequenceSet
public class BasicMLSequenceSet extends java.lang.Object implements java.io.Serializable, MLSequenceSet
A basic implementation of the MLSequenceSet.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classBasicMLSequenceSet.BasicMLSeqIteratorAn iterator to be used with the BasicMLDataSet.
-
Constructor Summary
Constructors Constructor and Description BasicMLSequenceSet()Default constructor.BasicMLSequenceSet(BasicMLSequenceSet other)BasicMLSequenceSet(double[][] input, double[][] ideal)Construct a data set from an input and ideal array.BasicMLSequenceSet(java.util.List<MLDataPair> theData)Construct a data set from an already created list.BasicMLSequenceSet(MLDataSet set)Copy whatever dataset type is specified into a memory dataset.
-
Method Summary
All 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.voidadd(MLDataSet sequence)Add a new sequence.java.lang.Objectclone()voidclose()Close this datasource and release any resources obtained by it, including any iterators created.MLDataPairget(int index)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.MLDataSetgetSequence(int i)Get an individual sequence.intgetSequenceCount()java.util.Collection<MLDataSet>getSequences()booleanisSupervised()java.util.Iterator<MLDataPair>iterator()MLDataSetopenAdditional()Opens an additional instance of this dataset.intsize()voidstartNewSequence()Cause a "break" in the data by creating a the beginning of a new sequence.
-
-
-
Constructor Detail
-
BasicMLSequenceSet
public BasicMLSequenceSet()
Default constructor.
-
BasicMLSequenceSet
public BasicMLSequenceSet(BasicMLSequenceSet other)
-
BasicMLSequenceSet
public BasicMLSequenceSet(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.
-
BasicMLSequenceSet
public BasicMLSequenceSet(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.
-
BasicMLSequenceSet
public BasicMLSequenceSet(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.
-
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.
-
startNewSequence
public void startNewSequence()
Description copied from interface:MLSequenceSetCause a "break" in the data by creating a the beginning of a new sequence.- Specified by:
startNewSequencein interfaceMLSequenceSet
-
getSequenceCount
public int getSequenceCount()
- Specified by:
getSequenceCountin interfaceMLSequenceSet- Returns:
- Get a count of the number of sequences.
-
getSequence
public MLDataSet getSequence(int i)
Description copied from interface:MLSequenceSetGet an individual sequence.- Specified by:
getSequencein interfaceMLSequenceSet- Parameters:
i- The index of the sequence.- Returns:
- The sequence.
-
getSequences
public java.util.Collection<MLDataSet> getSequences()
- Specified by:
getSequencesin interfaceMLSequenceSet- Returns:
- A list of all of the sequences.
-
get
public MLDataPair get(int index)
-
add
public void add(MLDataSet sequence)
Description copied from interface:MLSequenceSetAdd a new sequence.- Specified by:
addin interfaceMLSequenceSet- Parameters:
sequence- The sequence to add.
-
-
DMelt 3.0 © DataMelt by jWork.ORG