0

I've searched and search but can't find the answer. I have a c5_model trained and ready but I needed to do 100 trails to get it working to the level I want it to. But I'm stuck on trying to get it out of the model in R. I have done a summary but how do I get the decision tree out. Which trial do I want to use? enter image description here

Update:

I'm building the model by doing the following

control <- trainControl(method = "repeatedcv", 
                    number = 5, 
                    repeats = 3, 
                    classProbs = TRUE, 
                    summaryFunction = twoClassSummary)
grid <- expand.grid( .winnow = c(FALSE), 
                 .trials=100, 
                 .model="tree" )
c5_model <- train(HasFraud ~ .,data = train, method = "C5.0",trControl = control,metric = "ROC",tuneGrid = grid,verbose = FALSE)

Is this the wrong method to train the model?

  • 1
    please do not post images of your code or data. – De Novo Mar 27 '18 at 00:03
  • What do you mean when you say "I needed to do 100 trails to get it working to the level I want it to"? Were you adjusting the parameters each time? Or were you just trying to get an idea of the variation in the accuracy? Why 100 trials? – G5W Mar 27 '18 at 00:12
  • 1. Sorry about the image, got frustrated trying to paste. 2. I set trails = 100. I did 100 trials because it was the max. and yes I was trying to get an idea of the variation in accuracy. – user1789474 Mar 27 '18 at 15:26

1 Answers1

1

An object of class C5.0 has a number of elements, as described in the help file you can pull up with ?C50::C5.0.default. One of those elements is tree. If you've assigned the output of a call to C5.0() to a value, say model, you can extract any of its elements using the $ operator. For example:

model <- C5.0(<the call you made that generated the model>)
model$tree
De Novo
  • 7,120
  • 1
  • 23
  • 39