*/
@Override
public double calculateScore(final MLMethod algo) {
ErrorCalculation ec = this.errorCalc.create();
final RegressionAlgorithm ralgo = (RegressionAlgorithm) algo;
final Genome genome = (Genome)ralgo;
if( genome.size()>this.maxLength ) {
return Double.POSITIVE_INFINITY;
}
// evaulate
ec.clear();
for (final BasicData pair : this.trainingData) {
final double[] output = ralgo.computeRegression(pair.getInput());
ec.updateError(output, pair.getIdeal(), 1.0);
}
return ec.calculate();
}