[R] Help to improve prediction from supervised mapping using kohonen package

Ben Harrison harb at student.unimelb.edu.au
Thu Jul 25 03:54:28 CEST 2013


On 24 July 2013 21:32, Ben Harrison <harb at student.unimelb.edu.au> wrote:
> On 24 July 2013 19:25, ONKELINX, Thierry <Thierry.ONKELINX at inbo.be> wrote:
>> Try rescaling your data prior to splitting it up into a training and test set. Otherwise you end up with two different ways of scaling.

> I still cannot understand how I can sensibly revert the scaling of the values.

I understand more now about the scaling attributes. I think the
following fixes my earlier errors:

# Unscale the predictions:
descale <- attr(testing, 'scaled:scale')[["MEAS_TC"]]
decentre <- attr(testing, 'scaled:center')[["MEAS_TC"]]
predicted.tc <- lapply(tc.xyf.prediction$prediction, function(x) x *
descale + decentre)



More information about the R-help mailing list