1

I create the model and do the predicition with this script in R,

model = C5.0(dataset1[1:100, -7], dataset1[1:100, 7])

if I run summary(model), the output is just confusion matrix and the decision tree. Then, how to know the all prediction result that includes all data that already processed with all attributes, actual class and the prediction class?

Thank you.

UseR10085
  • 7,120
  • 3
  • 24
  • 54
ferdianm10
  • 55
  • 4

1 Answers1

0

You can use pred = predict(model, dataset1[1:100, 7]) to get the predicted classes followed by cbind.data.frame(dataset1[1:100, 7], pred) to get actual class and the prediction class side by side. You can also use plot(model) to get a beautiful decision tree.

The operations can be performed after installing and loading the library C50.

UseR10085
  • 7,120
  • 3
  • 24
  • 54
  • @FerdianMaulanaAkbar If it has helped you, [please accept the answer](https://stackoverflow.com/help/someone-answers) by clicking on checkmark next to vote button on the left. – UseR10085 Feb 17 '20 at 09:09