I work with credit.csv to create a learning tree, data is available in:
https://github.com/stedy/Machine-Learning-with-R-datasets/blob/master/credit.csv
and I took the following steps:
credit<-read.csv("credit.csv")
set.seed(12345)
credit_rand<-credit[order(runif(1000)),]
credit_train<-credit_rand[1:900,]
credit_test<-credit_rand[901:1000,]
library(C50)
credit_model<-C5.0(credit_train[-21],credit_train$default)
In the manual that I follow, it appears that I should get rid of the last column, which is the default, but I got the following error:
Error en C5.0.default(credit_train[, -21], credit_train$default) :
C5.0 models require a factor outcome
I tried changing the last line to:
credit_model<-C5.0(credit_train[,-21],credit_train$default)
but without success.
Any help?
source
share