* @param data
* The training set.
* @return The error percentage.
*/
public double calculateError(final EngineIndexableSet data) {
final ErrorCalculation errorCalculation = new ErrorCalculation();
final double[] actual = new double[this.outputCount];
final EngineData pair = BasicEngineData.createPair(data.getInputSize(),
data.getIdealSize());
for (int i = 0; i < data.getRecordCount(); i++) {
data.getRecord(i, pair);
compute(pair.getInputArray(), actual);
errorCalculation.updateError(actual, pair.getIdealArray());
}
return errorCalculation.calculate();
}