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

Ben Harrison harb at student.unimelb.edu.au
Wed Jul 24 13:32:40 CEST 2013


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 was mistaken, there is a visible improvement!

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

# ===== #
meas.tc <- testing[, "MEAS_TC"] * attr(testing, 'scaled:scale') +
attr(testing, 'scaled:center')
predicted.tc <- tc.xyf.prediction$prediction * attr(testing,
'scaled:scale') + attr(testing, 'scaled:center')
# ===== #

but I get warnings, and values that are very wrong:

Warning messages:
1: In testing[, "MEAS_TC"] * attr(testing, "scaled:scale") :
  longer object length is not a multiple of shorter object length
2: In testing[, "MEAS_TC"] * attr(testing, "scaled:scale") + attr(testing,  :
  longer object length is not a multiple of shorter object length

The original values for somdata["MEAS_TC"] are around 0.5 to 3, but
the unscaled values are about -170 to 700.



More information about the R-help mailing list