Baoqiang,
Here's an approach that should work:
(1) Make sure that the column names of trainx and testx are the same.
(2) Combine trainy and trainx into a data frame for fitting the model.
(2) Use the newdata= argument in the predict() function.
(3) Convert testx from matrix to data frame.
# some
On Wed, Oct 10, 2012 at 3:35 PM, Baoqiang Cao wrote:
> Hi,
>
> I have a question about using lm on matrix, have to admit it is very
> trivial but I just couldn't find the answer after searched the mailing
> list and other online tutorial. It would be great if you could help.
>
> I have a matrix "t
Hi,
I have a question about using lm on matrix, have to admit it is very
trivial but I just couldn't find the answer after searched the mailing
list and other online tutorial. It would be great if you could help.
I have a matrix "trainx" of 492(rows) by 220(columns) that is my x,
and trainy is 49
3 matches
Mail list logo