FoldedDataSet
org.encog.ml.data.folded

Class FoldedDataSet

  • All Implemented Interfaces:
    Iterable<MLDataPair>, MLDataSet


    public class FoldedDataSetextends Objectimplements 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 Detail

    • Constructor Detail

      • FoldedDataSet

        public FoldedDataSet(MLDataSet theUnderlying)
        Create a folded dataset.
        Parameters:
        theUnderlying - The underlying folded dataset.
    • Method Detail

      • add

        public final void add(MLData data1)
        Not supported.
        Specified by:
        add in interface MLDataSet
        Parameters:
        data1 - Not used.
      • add

        public final void add(MLData inputData,       MLData idealData)
        Not supported.
        Specified by:
        add in interface MLDataSet
        Parameters:
        inputData - Not used.
        idealData - Not used.
      • add

        public final void add(MLDataPair inputData)
        Not supported.
        Specified by:
        add in interface MLDataSet
        Parameters:
        inputData - Not used.
      • close

        public final void close()
        Close the dataset.
        Specified by:
        close in interface MLDataSet
      • fold

        public final void fold(int theNumFolds)
        Fold the dataset. Must be done before the dataset is used.
        Parameters:
        theNumFolds - The number of folds.
      • getCurrentFold

        public final int getCurrentFold()
        Returns:
        the currentFold
      • getCurrentFoldOffset

        public final int getCurrentFoldOffset()
        Returns:
        the currentFoldOffset
      • getCurrentFoldSize

        public final int getCurrentFoldSize()
        Returns:
        the currentFoldSize
      • getIdealSize

        public final int getIdealSize()
        Specified by:
        getIdealSize in interface MLDataSet
        Returns:
        The size of the input data.
      • getInputSize

        public final int getInputSize()
        Specified by:
        getInputSize in interface MLDataSet
        Returns:
        The size of the input data.
      • getNumFolds

        public final int getNumFolds()
        Returns:
        the numFolds
      • getOwner

        public final FoldedDataSet getOwner()
        Returns:
        The owner.
      • getRecord

        public final void getRecord(long index,             MLDataPair pair)
        Read an individual record, specified by index, in random order.
        Specified by:
        getRecord in interface MLDataSet
        Parameters:
        index - The index to read.
        pair - The pair that the record will be copied into.
      • getRecordCount

        public final long getRecordCount()
        Determine the total number of records in the set.
        Specified by:
        getRecordCount in interface MLDataSet
        Returns:
        The total number of records in the set.
      • getUnderlying

        public final MLDataSet getUnderlying()
        Returns:
        The underlying dataset.
      • isSupervised

        public final boolean isSupervised()
        Specified by:
        isSupervised in interface MLDataSet
        Returns:
        True if this is a supervised training set.
      • openAdditional

        public final MLDataSet openAdditional()
        Opens an additional instance of this dataset.
        Specified by:
        openAdditional in interface MLDataSet
        Returns:
        The new instance.
      • setCurrentFold

        public final void setCurrentFold(int theCurrentFold)
        Set the current fold.
        Parameters:
        theCurrentFold - the currentFold to set
      • setOwner

        public final void setOwner(FoldedDataSet theOwner)
        Parameters:
        theOwner - The owner.

SCaVis 2.0 © jWork.ORG