社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  cuttlefish44  »  全部回复
回复总数  1
5 年前
回复了 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.