dane <- read.table(file = "http://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/wpbc.data",sep=",", dec = ".")
library(randomForest)
library(cvTools)
cv <- cvFit(randomForest, x=dane[,-2], y=dane[,2], R=10, k=100, args=list(ntree=500),foldType = "random",cost = rmspe)
答案 0 :(得分:1)
cvFit函数专为数字结果而设计。尽管randomForest对因子结果没有任何困难(在这种情况下它会进行分类),但结果正在由期望回归模型的函数处理。