From the course: Data Science Foundations: Data Mining in R

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Decision trees

Decision trees

- [Instructor] The final method for classification that we're going to look at, there are many, many other possibilities, but the one that we're going to look at in this data mining course is decision trees. This is actually one of the most useful ways of visualizing what's happening in the decision process. To do this, I'm going to load a few functions caret and e1071, which I use for almost all classification as well as rattle which makes very pretty plots for decision trees. So I'm going to load those packages and set the random seed because we have randomness going on in this. Then I'll import the training data set and the testing data set that we created earlier. We need to do the training control parameters. These are the exact same parameters we've had before that say repeated CV for cross validation, five folds and three sets of folds. Then we're actually going to do the decision tree itself. Again, we use the…

Contents