Documentation of 'org.encog.ml.data.versatile.MatrixMLDataSet' Java class
MatrixMLDataSet
org.encog.ml.data.versatile

Class MatrixMLDataSet

  • All Implemented Interfaces:
    java.lang.Iterable<MLDataPair>, MLDataSet
    Direct Known Subclasses:
    VersatileMLDataSet


    public class MatrixMLDataSet
    extends java.lang.Object
    implements MLDataSet
    The MatrixMLDataSet can use a large 2D matrix of doubles to internally hold data. It supports several advanced features such as the ability to mask and time-box. Masking allows several datasets to use the same backing array, however use different parts. Time boxing allows time-series data to be represented for prediction. The following shows how data is laid out for different lag and lead settings. Lag 0; Lead 0 [10 rows] 1→1 2→2 3→3 4→4 5→5 6→6 7→7 8→8 9→9 10→10 Lag 0; Lead 1 [9 rows] 1→2 2→3 3→4 4→5 5→6 6→7 7→8 8→9 9→10 Lag 1; Lead 0 [9 rows, not useful] 1,2→1 2,3→2 3,4→3 4,5→4 5,6→5 6,7→6 7,8→7 8,9→8 9,10→9 Lag 1; Lead 1 [8 rows] 1,2→3 2,3→4 3,4→5 4,5→6 5,6→7 6,7→8 7,8→9 8,9→10 Lag 1; Lead 2 [7 rows] 1,2→3,4 2,3→4,5 3,4→5,6 4,5→6,7 5,6→7,8 6,7→8,9 7,8→9,10 Lag 2; Lead 1 [7 rows] 1,2,3→4 2,3,4→5 3,4,5→6 4,5,6→7 5,6,7→8 6,7,8→9 7,8,9→10
    • Constructor Detail

      • MatrixMLDataSet

        public MatrixMLDataSet()
        The default constructor.
      • MatrixMLDataSet

        public MatrixMLDataSet(double[][] theData,
                               int theCalculatedInputSize,
                               int theCalculatedIdealSize)
        Construct the dataset with no mask.
        Parameters:
        theData - The backing array.
        theCalculatedInputSize - The input size.
        theCalculatedIdealSize - The ideal size.
      • MatrixMLDataSet

        public MatrixMLDataSet(double[][] theData,
                               int inputCount,
                               int idealCount,
                               int[] theMask)
        Construct the dataset from a 2D double array..
        Parameters:
        theData - The data.
        inputCount - The input count.
        idealCount - The ideal count.
        theMask - The mask.
      • MatrixMLDataSet

        public MatrixMLDataSet(MatrixMLDataSet data,
                               int[] mask)
        Construct the dataset from another matrix dataset.
        Parameters:
        data - The data.
        mask - The mask.
    • Method Detail

      • getMask

        public int[] getMask()
        Returns:
        The mask.
      • iterator

        public java.util.Iterator<MLDataPair> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<MLDataPair>
      • getIdealSize

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

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

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

        public 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.
      • getRecord

        public 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.
      • openAdditional

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

        public void add(MLData data1)
        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.
        Specified by:
        add in interface MLDataSet
        Parameters:
        data1 - The data item to be added.
      • 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.
        Specified by:
        add in interface MLDataSet
        Parameters:
        inputData - Input data.
        idealData - Ideal data.
      • 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.
        Specified by:
        add in interface MLDataSet
        Parameters:
        inputData - A MLDataPair object that contains both input and ideal data.
      • close

        public void close()
        Close this datasource and release any resources obtained by it, including any iterators created.
        Specified by:
        close in interface MLDataSet
      • size

        public int size()
        Specified by:
        size in interface MLDataSet
      • getCalculatedInputSize

        public int getCalculatedInputSize()
        Returns:
        the calculatedInputSize
      • setCalculatedInputSize

        public void setCalculatedInputSize(int calculatedInputSize)
        Parameters:
        calculatedInputSize - the calculatedInputSize to set
      • getCalculatedIdealSize

        public int getCalculatedIdealSize()
        Returns:
        the calculatedIdealSize
      • setCalculatedIdealSize

        public void setCalculatedIdealSize(int calculatedIdealSize)
        Parameters:
        calculatedIdealSize - the calculatedIdealSize to set
      • getData

        public double[][] getData()
        Returns:
        the data
      • setData

        public void setData(double[][] data)
        Parameters:
        data - the data to set
      • getLagWindowSize

        public int getLagWindowSize()
        Returns:
        the lagWindowSize
      • setLagWindowSize

        public void setLagWindowSize(int lagWindowSize)
        Parameters:
        lagWindowSize - the lagWindowSize to set
      • getLeadWindowSize

        public int getLeadWindowSize()
        Returns:
        the leadWindowSize
      • setLeadWindowSize

        public void setLeadWindowSize(int leadWindowSize)
        Parameters:
        leadWindowSize - the leadWindowSize to set

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.