/// <summary> /// Get input data - S&P 500 Index, Prime Interest Rate, Dow index, Nasdaq index /// </summary> /// <param name="offset">Start index of input data</param> /// <param name="input">Array to be populated</param> /// <remarks> /// According to the <c>offset</c> parameter, first <c>_inputSize</c> values are drawn from the dataset /// </remarks> public void GetInputData(int offset, double[] input) { int total = 0; int k = 0; // get OHLCVI *_pointCount for (int i = 0; i < _pointCount; i++) { PredicInput sample = _samples[offset + i]; k = 0; foreach (PredicInputIndexe index in Enum.GetValues(typeof(PredicInputIndexe))) { if (sample.IsSetValue((int)index)) { input[i * total + k] = sample.GetValue((int)index); k++; } } if (total < 1) { total = k; } //input[i*4] = sample.Open; //input[i*4 + 1] = sample.H; //input[i*4 + 2] = sample.L; //input[i*4 + 3] = sample.C; } }
/// <summary> /// Get output data - S&P 500 Index, Prime Interest Rate, Dow index, Nasdaq index /// </summary> /// <param name="offset">Start index of output data</param> /// <param name="output">Output array to be populated</param> /// <remarks> /// The value of <c>offset + _inputSize</c> indexes value are drawn from the samples data set. /// E.g. Consider the <c>offset</c> parameter equal to 12581. Input parameters to the network will be /// values from [12581..12590]. The actual values will be equal to the parameters stored in the <code>12581 + _inputSize</code> /// place => 12591 index. /// </remarks> public void GetOutputData(int offset, double[] output) { PredicInput sample = _samples[offset + _pointCount + _predictDayplus]; output[0] = sample.GetValue((int)PredicInputIndexe.CloseIndex); //output[1] = sample.PrimeInterestRate; //output[2] = sample.Commodity; //output[3] = sample.VolumeCommo; }