Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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-man

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

If money was no object, what would you do all day?

Answered: 1 week ago

Question

WHAT IS DOUBLE ENTRY ACCOUNTING SYSTEM?

Answered: 1 week ago