* {@inheritDoc}
*/
@Override
public final double calculateError(final MLDataSet data) {
final BestMatchingUnit bmu = new BestMatchingUnit(this);
bmu.reset();
// Determine the BMU for each training element.
for (final MLDataPair pair : data) {
final MLData input = pair.getInput();
bmu.calculateBMU(input);
}
// update the error
return bmu.getWorstDistance() / 100.0;
}