

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A decision tree is a graphical representation of choices and their results, used primarily in machine learning and data mining applications. In this example, we demonstrate how to create a decision tree using r and the party package. We will use the ctree() function to build the tree and visualize it.
What you will learn
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!
automatically load other
library(party)
input.dat <- readingSkills[c( 1 : 105 ),]
png(file = "decision_tree.png")
output.tree <- ctree( nativeSpeaker ~ age + shoeSize + score, data = input.dat)
plot(output.tree)
dev.off()
null device 1 Loading required package: methods Loading required package: grid Loading required package: mvtnorm Loading required package: modeltools Loading required package: stats Loading required package: strucchange Loading required package: zoo Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric Loading required package: sandwich