Re: [R] Error in 'Contrasts<-' while using GBM.

2015-11-30 Thread peter dalgaard
On 30 Nov 2015, at 02:59 , Max Kuhn wrote: > Providing a reproducible example and the results of `sessionInfo` will help > get your question answered. > > My only guess is that one or more of your predictors are factors and that > the in-sample data (used to build the model during resampling) h

Re: [R] Error in 'Contrasts<-' while using GBM.

2015-11-29 Thread Max Kuhn
Providing a reproducible example and the results of `sessionInfo` will help get your question answered. My only guess is that one or more of your predictors are factors and that the in-sample data (used to build the model during resampling) have different levels than the holdout samples. Max On

[R] Error in 'Contrasts<-' while using GBM.

2015-11-28 Thread Karteek Pradyumna Bulusu
Hey, I was trying to implement Stochastic Gradient Boosting in R. Following is my code in rstudio: library(caret); library(gbm); library(plyr); library(survival); library(splines); library(mlbench); set.seed(35); stack = read.csv("E:/Semester 3/BDA/PROJECT/Sample_SO.csv", head =TRUE,sep=