我不能复制你的问题没有
trnds1
/
testds1,
但也许下面是你想要的。
library(dplyr)
pred <- extractPrediction(list(NAME = ds1lnrsvm), # extractPrediction want list(model)
testX = select(testds1, -shortflag),
testY = pull(testds1, shortflag))
trnds1 %>% # train data
bind_rows(testds1) %>% # bind_rows with testdata
bind_cols(pred) # %>% # add cols of predict
# select(-shortflag) # shortflg is the same as obs, if you want please delete the col.