Hi,
Is there an alternative to the scale function where I can specify my own
mean and standard deviation?
I've come across an interesting issue where this would help.
I'm training and testing on completely different sets of data. The
testing set is smaller than the training set.
Using
I think I just answered my own question.
The scale function will return the mean and sd of the data.
So the process is fairly simple.
scale training data varaible
note mean and sd from the scale
then manually scale the test data using the mean and sd from the
training data.
That should make
On Fri, 2009-09-11 at 13:10 -0700, Noah Silverman wrote:
Hi,
Is there an alternative to the scale function where I can specify my own
mean and standard deviation?
A couple of calls to sweep?
See ?sweep
set.seed(123)
dat - data.frame(matrix(runif(10*10), ncol = 10))
xbar - colMeans(dat)
The scale function will return the mean and sd of the data.
By default. Read ?scale.
Mark.
Noah Silverman-3 wrote:
I think I just answered my own question.
The scale function will return the mean and sd of the data.
So the process is fairly simple.
scale training data varaible
Genius,
That certainly is much faster that what I had worked out on my own.
I looked at sweep, but couldn't understand the rather thin help page.
Your example makes it really clear
Thank You!!!
--
Noah
On 9/11/09 1:57 PM, Gavin Simpson wrote:
On Fri, 2009-09-11 at 13:10 -0700, Noah
5 matches
Mail list logo