confusion matrix von rpart

Ich kann nicht für das Leben von mir herauszufinden, wie zur Berechnung der confusion-matrix auf rpart.

Hier ist, was ich getan habe:

set.seed(12345)
UBANK_rand <- UBank[order(runif(1000)), ]
UBank_train <- UBank_rand[1:900, ]
UBank_test  <- UBank_rand[901:1000, ]


dim(UBank_train)
dim(UBank_test)

#Build the formula for the Decision Tree
UB_tree <- Personal.Loan ~ Experience + Age+ Income +ZIP.Code + Family + CCAvg + Education

#Building the Decision Tree from Test Data
UB_rpart <- rpart(UB_tree, data=UBank_train)

Nun, ich würde denken, ich würde etwas tun, wie

table(predict(UB_rpart, UBank_test, UBank_Test$Default))

Aber das ist nicht geben Sie mir eine confusion matrix.

InformationsquelleAutor mpg | 2014-01-22

Schreibe einen Kommentar