Message-ID: <b9a527c6-0ed2-c968-5a4a-c2b13012a9ff@pp.inet.fi>
Date: 2016-06-22T10:46:29Z
From: K. Elo
Subject: Y in Kohonen xyf function
In-Reply-To: <500416751.11999521.1466534016053.JavaMail.yahoo@mail.yahoo.com>
Hi again!
21.06.2016, 21:33, chalabi.elahe at yahoo.de wrote:
> Hi Kimmo, Thanks for your reply. I think now my problem is that I
> don't understand what does factor(df.classes[training]) do?
Sorry, my mistake, should habe been 'df$speed'. Please try the following:
--- snip ---
set.seed(7) training <- sample(nrow(df), 120)
Xtraining<- scale(df[training,])
Xtest <- scale(df[-training,], center = attr(Xtraining,
"scaled:center"), scale = attr(Xtraining,
"scaled:scale"))
xyf.df <- xyf(Xtraining, factor(df$speed[training]), grid =
somgrid(5, 5, "hexagonal"))
--- snip ---
HTH,
Kimmo