Jon Toledo
2011-Aug-28 02:43 UTC
[R] Trying to extract probabilities in CARET (caret) package with a glmStepAIC model
Dear developers, I have jutst started working with caret and all the nice features it offers. But I just encountered a problem: I am working with a dataset that include 4 predictor variables in Descr and a two-category outcome in Categ (codified as a factor). Everything was working fine I got the results, confussion matrix etc. BUT for obtaining the AUC and predicted probabilities I had to add " classProbs = TRUE," in the trainControl. Thereafter everytime I run train I get this message: "undefined columns selected" I copy the syntax: fitControl <- trainControl(method = "cv", number = 10, classProbs = TRUE,returnResamp = "all", verboseIter = FALSE) glmFit <- train(Descr, Categ, method = "glmStepAIC",tuneLength = 4,trControl = fitControl) Thank you. Best regards, Jon Toledo, MD Postdoctoral fellow University of Pennsylvania School of Medicine Center for Neurodegenerative Disease Research 3600 Spruce Street 3rd Floor Maloney Building Philadelphia, Pa 19104 [[alternative HTML version deleted]]
Max Kuhn
2011-Aug-28 17:23 UTC
[R] Trying to extract probabilities in CARET (caret) package with a glmStepAIC model
Can you provide a reproducible example and the results of sessionInfo()? What are the levels of your classes? On Sat, Aug 27, 2011 at 10:43 PM, Jon Toledo <tintin_jb at hotmail.com> wrote:> > Dear developers, > I have jutst started working with caret and all the nice features it offers. But I just encountered a problem: > I am working with a dataset that include 4 predictor variables in Descr and a two-category outcome in Categ (codified as a factor). > Everything was working fine I got the results, confussion matrix etc. > BUT for obtaining the AUC and predicted probabilities I had to add " classProbs = TRUE," in the trainControl. Thereafter everytime I run train I get this message: > "undefined columns selected" > > I copy the syntax: > fitControl <- trainControl(method = "cv", number = 10, classProbs = TRUE,returnResamp = "all", verboseIter = FALSE) > glmFit <- train(Descr, Categ, method = "glmStepAIC",tuneLength = 4,trControl = fitControl) > Thank you. > Best regards, > > Jon Toledo, MD > > Postdoctoral fellow > University of Pennsylvania School of Medicine > Center for Neurodegenerative Disease Research > 3600 Spruce Street > 3rd Floor Maloney Building > Philadelphia, Pa 19104 > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Max
Possibly Parallel Threads
- caret train and trainControl
- Inconsistent results between caret+kernlab versions
- caret() train based on cross validation - split dataset to keep sites together?
- How can you find the optimal number of values to randomly sample to optimize random forest classification without trial and error?
- Help with this error "kernlab class probability calculations failed; returning NAs"