(scaled-errors outputs targets penalty)(scaled-errors outputs targets penalty print-slope-and-intercept)

A utility function for use in error functions, to implement error-scaling as described by Maarten Keijzer in Scaled Symbolic Regression, in Genetic Programming and Evolvable Machines 5(3), pp. 259-269, September 2004. This returns a sequence of scaled errors given a sequence of outputs, a sequence of targets, and a penalty. If there are any non-numeric items in the outputs, or if all of the outputs are the same, then all of the scaled errors will be equal to the penalty – note that this means that you cannot use this method to solve a problem for which all targets are the same. An optional fourth argument, if true, causes the scaling slope and intercept to be printed; this is necessary for unscaling outputs of an evolved solution – see examples/scaled_sextic.clj for an example.