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)
Asked
Active
Viewed 2,764 times
0

Moumit
- 8,314
- 9
- 55
- 59

Taras Haliuk
- 9
- 1
- 2
-
2Post warnings as text, not picture. – zx8754 Jun 14 '16 at 13:18
-
1Welcome to Stack Overflow! Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) – zx8754 Jun 14 '16 at 13:19
-
See this example, maybe convert factor to numeric first: `x <- factor(1:3); x - 1` – zx8754 Jun 14 '16 at 13:21
1 Answers
1
The cvFit function is designed for numeric outcomes. Although randomForest has no difficulty with factor outcomes (in which case it does classification), the results are being processed by a function that expects a regression model.

IRTFM
- 258,963
- 21
- 364
- 487