0

I have been trying to make a lift curve from my Logistic Regression but it doesn't seem to work.

Following it the code I have been trying

inTrain <- createDataPartition(y = Data$Response, p = .60, list = FALSE)
training <- Data[inTrain,]
testing <- Data[-inTrain,]
fullmod = glm(Response ~ page_views_90d+win_visits+osx_visits+mc_1+mc_2+mc_3+mc_4+mc_5+mc_6+store_page+orders+orderlines+bookings+purchase, family=binomial(logit),data=training )
lift.chart(c("fullmod"), data=training, targLevel="Yes",
           trueResp=0.01, type="incremental", sub="Test")

I keep getting the following error,

Error in lift.chart(c("fullmodWorks"), data = DataVal, targLevel = 1,  : 
  The y variable must be a two-level factor.
paddy
  • 123
  • 1
  • 2
  • 13
  • Hi, welcome to *Stack Overflow*, in order that we can help you best, please provide example data. Consider [*How to make a great reproducible example*](https://stackoverflow.com/a/5963610/6574038), thanks. – jay.sf Mar 17 '18 at 19:41

1 Answers1

0

Try this before creating the train/test partitions.

Data$Response <- as.factor(Data$Response)
DMillan
  • 119
  • 6