私信  •  关注

cuttlefish44

cuttlefish44 最近创建的主题
cuttlefish44 最近回复了
4 年前
回复了 cuttlefish44 创建的主题 » R中插入符号机器学习模型的预测值提取

我不能复制你的问题没有 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.