Here is the output I need to see:
Here is my code that worked so far:
install.packages("rpart")
library(part)
Here are the two lines of code I attempted without success and the corresponding error messages:
PolicyTree <-rpart(Insurance_Category ~ Gender + Age + Marital_Status + Account_Activity + Claim_12Mo + Accident_36Mo + Ticket_12Mo +Payment_Method, mehod = 'class')
Error in eval(predvars, data, env) :
object 'Insurance_Category' not found
PolicyBuyers<-rpart(Insurance_Category ~ Gender + Age + Marital_Status + Account_Activity + Claim_12Mo + Accident_36Mo + Ticket_12Mo +Payment_Method, mehod = 'class')
Error in eval(predvars, data, env) :
object 'Insurance_Category' not found
I am attempting to code for a decision tree and use the decision tree to analyze two .csv files, which are
PolicyHolders.csv and PolicyBuyers.csv.
I could import both files and generate the tables I needed to see.
I tried this as well:
PolicyHolders<-read.csv("PolicyHolders.csv"," header = TRUE)
- attach(PolicyHolders)
- head(PolicyHolders)
- summary(PolicyHolders)