Database Reference
In-Depth Information
library("rpart") # load libraries
library("rpart.plot")
The working directory contains a comma-separated-value (CSV) file named
DTdata.csv . The file has a header row, followed by 10 rows of training data.
Play,Outlook,Temperature,Humidity,Wind
yes,rainy,cool,normal,FALSE
no,rainy,cool,normal,TRUE
yes,overcast,hot,high,FALSE
no,sunny,mild,high,FALSE
yes,rainy,cool,normal,FALSE
yes,sunny,cool,normal,FALSE
yes,rainy,cool,normal,FALSE
yes,sunny,hot,normal,FALSE
yes,overcast,mild,high,TRUE
no,sunny,mild,high,TRUE
The CSV file contains five attributes: Play, Outlook, Temperature,
Humidity, and Wind. Play would be the output variable (or the predicted
class), and Outlook, Temperature, Humidity, and Wind would be the input
variables. In R, read the data from the CSV file in the working directory and display
the content.
play_decision <-
read.table("DTdata.csv",header=TRUE,sep=",")
play_decision
Play Outlook Temperature Humidity Wind
1 yes rainy cool normal FALSE
2 no rainy cool normal TRUE
3 yes overcast hot high FALSE
4 no sunny mild high FALSE
5 yes rainy cool normal FALSE
6 yes sunny cool normal FALSE
7 yes rainy cool normal FALSE
8 yes sunny hot normal FALSE
9 yes overcast mild high TRUE
10 no sunny mild high TRUE
Search WWH ::




Custom Search