Encog.ML.Data.Buffer.BufferedMLDataSet.GetRecord C# (CSharp) Method

GetRecord() public method

Read an individual record.
public GetRecord ( long index, IMLDataPair pair ) : void
index long The zero-based index. Specify 0 for the first record, 1 for /// the second, and so on.
pair IMLDataPair The data to read.
return void
        public void GetRecord(long index, IMLDataPair pair)
        {
            double[] inputTarget = pair.InputArray;
            double[] idealTarget = pair.IdealArray;

            egb.SetLocation((int) index);
            egb.Read(inputTarget);
            egb.Read(idealTarget);
            pair.Significance = egb.Read();
        }

Usage Example

        /// <summary>
        /// Move to the next element.
        /// </summary>
        /// <returns>True if there are more elements to read.</returns>
        public bool MoveNext()
        {
            try
            {
                if (_current >= _data.Count)
                {
                    return(false);
                }

                _currentRecord = BasicMLDataPair.CreatePair(_data
                                                            .InputSize, _data.IdealSize);
                _data.GetRecord(_current++, _currentRecord);
                return(true);
            }
            catch (EndOfStreamException)
            {
                return(false);
            }
        }
All Usage Examples Of Encog.ML.Data.Buffer.BufferedMLDataSet::GetRecord