Question
Please write the entire R program in Rstudio: Given the attached diabetes data set. Read the data set description separate file. 1. Input the data
Please write the entire R program in Rstudio:
Given the attached diabetes data set. Read the data set description separate file. 1. Input the data 2. Separate the data into learning set (~2/3 of all records) and test data. 3. Built the classification trees using CART (rpart) and C4.5 (J48) trees. 4. Plot the rpart tree and C4.5 tree 5. Predict the classes of records in test data. What is the accuracy for each tree? Generate table of predicted classes vs known classes in test set 6. Are trees the same? If not which one is smaller? Why? Are accuracies the same?
Note that for class attribute imported from CSV file values 0,1 are interpreted as integers upon input. To apply any classification algorithm they must be factors. So you need to convert data types (i.e. integer to factor) similarly to the following example. Suppose aaa$type are integers in {1,2,3}: aaa$type
the following is an excel sheet that needs to be converted into CSV file. Also there are 769 rows of data with the same attributes. put data into excel and convert to CSV.
8 diabetes IReod-Dely.-Ecd Normal!Bad Good Neutral Calculation: 4tctim -A Check Ccll Linked Cell Sort class 10/10/2017 21 33 26 29 53 54 3 3 7 y 1 3 3 1 3 3 77 50 41 79 1 41 43 223 GO 28 28 45 33 35 1401 89 11 78 1 197 125 220 6A as 199 160 100 110 102 103 11 150 199 las 125 47 5717 103 198$2 izz 103- 12 13 14 16 17 su q 20 al 72 23 24 75 26 zr 7A 20 au 31 32 34 20 37 38 | rim rno r-man 8 diabetes IReod-Dely.-Ecd Normal!Bad Good Neutral Calculation: 4tctim -A Check Ccll Linked Cell Sort class 10/10/2017 21 33 26 29 53 54 3 3 7 y 1 3 3 1 3 3 77 50 41 79 1 41 43 223 GO 28 28 45 33 35 1401 89 11 78 1 197 125 220 6A as 199 160 100 110 102 103 11 150 199 las 125 47 5717 103 198$2 izz 103- 12 13 14 16 17 su q 20 al 72 23 24 75 26 zr 7A 20 au 31 32 34 20 37 38 | rim rno r-manStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started