org.encog.ml.data.folded
Class FoldedDataSet
- java.lang.Object
-
- org.encog.ml.data.folded.FoldedDataSet
-
- All Implemented Interfaces:
- java.lang.Iterable<MLDataPair>, MLDataSet
public class FoldedDataSet extends java.lang.Object implements MLDataSet
A folded data set allows you to "fold" the data into several equal(or nearly equal) datasets. You then have the ability to select which fold the dataset will process. This is very useful for crossvalidation. This dataset works off of an underlying dataset. By default there are no folds (fold size 1). Call the fold method to create more folds.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringADD_NOT_SUPPORTEDError message: adds are not supported.
-
Constructor Summary
Constructors Constructor and Description FoldedDataSet(MLDataSet theUnderlying)Create a folded dataset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(MLData data1)Not supported.voidadd(MLData inputData, MLData idealData)Not supported.voidadd(MLDataPair inputData)Not supported.voidclose()Close the dataset.voidfold(int theNumFolds)Fold the dataset.MLDataPairget(int index)intgetCurrentFold()intgetCurrentFoldOffset()intgetCurrentFoldSize()intgetIdealSize()intgetInputSize()intgetNumFolds()FoldedDataSetgetOwner()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.MLDataSetgetUnderlying()booleanisSupervised()java.util.Iterator<MLDataPair>iterator()MLDataSetopenAdditional()Opens an additional instance of this dataset.voidsetCurrentFold(int theCurrentFold)Set the current fold.voidsetOwner(FoldedDataSet theOwner)intsize()
-
-
-
Field Detail
-
ADD_NOT_SUPPORTED
public static final java.lang.String ADD_NOT_SUPPORTED
Error message: adds are not supported.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FoldedDataSet
public FoldedDataSet(MLDataSet theUnderlying)
Create a folded dataset.- Parameters:
theUnderlying- The underlying folded dataset.
-
-
Method Detail
-
add
public void add(MLData data1)
Not supported.
-
add
public void add(MLDataPair inputData)
Not supported.
-
fold
public void fold(int theNumFolds)
Fold the dataset. Must be done before the dataset is used.- Parameters:
theNumFolds- The number of folds.
-
getCurrentFold
public int getCurrentFold()
- Returns:
- the currentFold
-
getCurrentFoldOffset
public int getCurrentFoldOffset()
- Returns:
- the currentFoldOffset
-
getCurrentFoldSize
public int getCurrentFoldSize()
- Returns:
- the currentFoldSize
-
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.
-
getNumFolds
public int getNumFolds()
- Returns:
- the numFolds
-
getOwner
public FoldedDataSet getOwner()
- Returns:
- The owner.
-
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.
-
getUnderlying
public MLDataSet getUnderlying()
- Returns:
- The underlying dataset.
-
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.
-
setCurrentFold
public void setCurrentFold(int theCurrentFold)
Set the current fold.- Parameters:
theCurrentFold- the currentFold to set
-
setOwner
public void setOwner(FoldedDataSet theOwner)
- Parameters:
theOwner- The owner.
-
get
public MLDataPair get(int index)
-
-
DMelt 3.0 © DataMelt by jWork.ORG