Re: [R] Training a model using glm

2014-09-18 Thread Mohan Radhakrishnan
Oh. I understand now. There is nothing wrong with the logic. It is the syntax. library(AppliedPredictiveModeling) *Warning message:* *package ‘AppliedPredictiveModeling’ was built under R version 3.1.1 * set.seed(3433) data(AlzheimerDisease) adData = data.frame(diagnosis,predictors)

Re: [R] Training a model using glm

2014-09-18 Thread Mohan Radhakrishnan
Thanks Max and Dennis. Based on the syntax change I got the result for the PCA part also. training2 - training[,grepl(^IL,names(training))] preProc - preProcess(training2,method=pca,thresh=0.8) test2 - testing[,grepl(^IL,names(testing))] trainpca - predict(preProc, training2) testpca -

[R] Training a model using glm

2014-09-17 Thread Mohan Radhakrishnan
I answered this question which was part of the online course correctly by executing some commands and guessing. But I didn't get the gist of this approach though my R code works. I have a training and test dataset. nrow(training) [1] 251 nrow(testing) [1] 82 head(training1) diagnosis

Re: [R] Training a model using glm

2014-09-17 Thread Mohan Radhakrishnan
Hi Dennis, Why is there that warning ? I think my syntax is right. Isn't it not? So the warning can be ignored ? Thanks, Mohan On Wed, Sep 17, 2014 at 9:48 PM, Dennis Murphy djmu...@gmail.com wrote: No reproducible example (i.e., no data) supplied, but the following

Re: [R] Training a model using glm

2014-09-17 Thread Max Kuhn
You have not shown all of your code and it is difficult to diagnose the issue. I assume that you are using the data from: library(AppliedPredictiveModeling) data(AlzheimerDisease) If so, there is example code to analyze these data in that package. See ?scriptLocation. We have no idea how