[R] Easy Uplift Tree Classify Error

Brian b_miner at live.com
Fri Dec 6 18:25:54 CET 2013


Does anyone know if the error being generated when trying to predict 
test set data in the Easy Uplift Tree package is something fixable by 
the user or is this a bug in the program making the package essentially 
non-operable?
This is from the package documentation and fails on the last step of 
applying the model to the test set:


install.packages("EasyUpliftTree")
library(EasyUpliftTree)
library(survival)
data(colon)


#APPEARS TO WORK

sample.data <- na.omit(colon[colon$rx != "Lev" & colon$etype == 2, ])
treat <- ifelse(sample.data$rx == "Lev+5FU", 1, 0)
y <- ifelse(sample.data$status == 0, 1, 0)
x <- sample.data[, c(4:9, 11:14)]
x$v1 <- factor(x$sex)
x$v2 <- factor(x$obstruct)
x$v3 <- factor(x$perfor)
x$v4 <- factor(x$adhere)
x$v5 <- factor(x$differ)
x$v6 <- factor(x$extent)
x$v7 <- factor(x$surg)
x$v8 <- factor(x$node4)


index <- 1:nrow(x)
train.index <- index[(index%%2 == 0)]
test.index <- index[index%%2 != 0]
y.train <- y[train.index]
x.train <- x[train.index, ]
treat.train <- treat[train.index]
y.test <- y[test.index]
x.test <- x[test.index, ]
treat.test <- treat[test.index]
uplift.tree <- buildUpliftTree(y.train, treat.train, x.train)
print(uplift.tree)


#FAILS

apply(1:nrow(x.test), function(i) classify(uplift.tree, x.test[i, ]))

#Error in match.fun(FUN) : argument "FUN" is missing, with no default



More information about the R-help mailing list