* Process the array.
* @param data The array to process.
* @return A neural data set that contains the time-series.
*/
public final MLDataSet process(final double[] data) {
final MLDataSet result = new BasicMLDataSet();
final int totalWindowSize = this.inputWindow + this.predictWindow;
final int stopPoint = data.length - totalWindowSize;
for (int i = 0; i < stopPoint; i++) {
final MLData inputData
= new BasicMLData(this.inputWindow);
final MLData idealData
= new BasicMLData(this.predictWindow);
int index = i;
// handle input window
for (int j = 0; j < this.inputWindow; j++) {
inputData.setData(j, data[index++]);
}
// handle predict window
for (int j = 0; j < this.predictWindow; j++) {
idealData.setData(j, data[index++]);
}
final MLDataPair pair = new BasicMLDataPair(inputData,
idealData);
result.add(pair);
}
return result;
}