Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

R Studio / R Script Help Need to get assistance on what pre-processing would be required for the question below What data pre-processing does the

R Studio / R Script Help

Need to get assistance on what pre-processing would be required for the question below

What data pre-processing does the Apriori method require for the credit approval data? Include the commands you ran and the output screenshots.

All numeric attributes must be converted to factor as part of the data preprocessing. credit data frame created and here is the head and structure ran to show csv. I tried to discretize A2, A3, A8, A11, A14 and A15 as they need to be factored. I used credit$A2

I have included the screen shots of each script and the summary. I see some NAs and some that need additional work. Included errors for some when I tried to use the first discretize method on A11, A14 and A15

Help would be great as I cannot proceed until pre-processing is complete.

#Discretize credit$A2

#Summary of credit A2 summary(credit$A2)

#Discretize credit$A3

#Summary of credit A3 summary(credit$A3)

#Discretize credit$A8

#Summary of credit A8 summary(credit$A8)

# Credit A11 add factor credit$A11

#Summary of A11 summary(credit$A11)

# Credit A14 add factor credit$A14

#Summary of A14 summary(credit$A14)

# Credit A15 add factor credit$A15

#Summary of A15 summary(credit$A15)

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Console Terminal Drive/School-New/R DBST667/LAB 3/ package aruiesviz was bui it under R version 3.5.2 > credit head(credit) sep=" ") , A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 class 1 b 30.83 0.000 u g v 1.25 t t 1f g 202 O 2 a 58. 67 4.460 u g q h 3.04 t t 6 f g 43 560 3 a 24. 50 0. 500 u g q h 1.50 t f 0 f g 280 824 4 b 27.83 1.540 u g v 3.75 t t 5 t g 100 3 5 b 20.17 5.625 u g w v 1.71 t f 0 f S 120 0 6 b 32.08 4.000 u g m v 2.50 t f 0t > str (credit) g 360 0 data. frame 690 obs. of 16 variables: $A1: Factor w/ 3 levels "", "a","b": 3 2 2 3 3 3 3 2 3 3 . . . $A2 : num 30.8 58.7 24. 5 27.8 20. 2 SA3 num 0 4.46 0. 5 1.54 5.62 SA4 Factor w/ 4 levels "","1","u","y": 3 3 3 3 3 3 3 3 4 4 . . . $ A5 Factor w/ 4 levels "", "g","gg", "p": 2 2 2 2 2 2 2 2 4 4 $ A6: Factor w/ 15 levels"" "aa","c","cc", .. : 14 12 12 14 14 11 13 4 10 14 $ A7: Factor w/ 10 levels"" "bb","dd","ff",. .: 9 5 5 999 5 9 5 9 .. . SA8 num 1.25 3.04 1. 5 3.75 1.71 SA9: Factor w/ 2 levels "f","t": 2 2 2 2 2 2 2 2 2 2 .. . 5 5 $A11 $ A12 int 1 6 0 5 0 0 0 0 0 0 .. Factor w/ 2 levels "f","t" 1 1 1 2 1 2 2 1 1 2 .. . $A14 int 202 43 280 100 120 360 164 80 180 52 . . . $A15 int 0 560 824 3 0 0 31285 1349 314 1442. . $ class: Factor w/ 2 levels """: 2 2 2 2 2 2 2 2 2 2 . . . 2 Console Terminal New/R DBST667/LAB3/ summary(creditSA2) 112 >summary (creditSA3) 108 > summary(credit$A8) [13. 8,20.8) [20. 8,23.9) [23.9,28. 5) [28. 5,34. 2) [34.2,42.2) [42.2,80.2] 113 NA s 12 112 115 110 116 [10,28] 115 [0,0. 585) [0. 585,1.5) [1. 5,2.75) [2.75,5.05) [5.05,10) 110 122 120 115 [0,0.085) [0.085,0.29) 119 [2,4.25) [4. 25,28. 5] 118 103 109 125 116 > credit$A1lcreditSA11summary(credit AL4) 0 132 60 120 35 220 200 35 400 9 96 160 34 340 80 30 360 100 30 380 280 40 176 112 350 180 18 140 16 108 240 14 132 4 272 320 14 144 300 13 232 4 460 260 420 480 168 560 52 152 440 4 20 520 128 150 92 312 164 110 330 181 129 352 216 130 370 32 102 73 228 21 75 136 396 43 290 145 399 154 500 49 141 210 225 17 62 163 252 720 86 93 121 156 167 170 174 178 (other NA s 72 13 >summary(creaitsALS) 500 10 20 1000 10 150 300 100 200 295 10 3000 400 560 600 2000 4000 5000 2 67 13 15 2 108 16 2 204 17 2 284 21 2 351 27 2 375 35 40 2 68 350 456 540 809 41 109 154 1200 1210 3065 12 59 122 173 14 23 80 134 195 25 87 140 32 70 130 184 98 105 112 113 120 126 141 146 147 158 160 162 168 179 196 (other) 141 Console Terminal Drive/School-New/R DBST667/LAB 3/ package aruiesviz was bui it under R version 3.5.2 > credit head(credit) sep=" ") , A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 class 1 b 30.83 0.000 u g v 1.25 t t 1f g 202 O 2 a 58. 67 4.460 u g q h 3.04 t t 6 f g 43 560 3 a 24. 50 0. 500 u g q h 1.50 t f 0 f g 280 824 4 b 27.83 1.540 u g v 3.75 t t 5 t g 100 3 5 b 20.17 5.625 u g w v 1.71 t f 0 f S 120 0 6 b 32.08 4.000 u g m v 2.50 t f 0t > str (credit) g 360 0 data. frame 690 obs. of 16 variables: $A1: Factor w/ 3 levels "", "a","b": 3 2 2 3 3 3 3 2 3 3 . . . $A2 : num 30.8 58.7 24. 5 27.8 20. 2 SA3 num 0 4.46 0. 5 1.54 5.62 SA4 Factor w/ 4 levels "","1","u","y": 3 3 3 3 3 3 3 3 4 4 . . . $ A5 Factor w/ 4 levels "", "g","gg", "p": 2 2 2 2 2 2 2 2 4 4 $ A6: Factor w/ 15 levels"" "aa","c","cc", .. : 14 12 12 14 14 11 13 4 10 14 $ A7: Factor w/ 10 levels"" "bb","dd","ff",. .: 9 5 5 999 5 9 5 9 .. . SA8 num 1.25 3.04 1. 5 3.75 1.71 SA9: Factor w/ 2 levels "f","t": 2 2 2 2 2 2 2 2 2 2 .. . 5 5 $A11 $ A12 int 1 6 0 5 0 0 0 0 0 0 .. Factor w/ 2 levels "f","t" 1 1 1 2 1 2 2 1 1 2 .. . $A14 int 202 43 280 100 120 360 164 80 180 52 . . . $A15 int 0 560 824 3 0 0 31285 1349 314 1442. . $ class: Factor w/ 2 levels """: 2 2 2 2 2 2 2 2 2 2 . . . 2 Console Terminal New/R DBST667/LAB3/ summary(creditSA2) 112 >summary (creditSA3) 108 > summary(credit$A8) [13. 8,20.8) [20. 8,23.9) [23.9,28. 5) [28. 5,34. 2) [34.2,42.2) [42.2,80.2] 113 NA s 12 112 115 110 116 [10,28] 115 [0,0. 585) [0. 585,1.5) [1. 5,2.75) [2.75,5.05) [5.05,10) 110 122 120 115 [0,0.085) [0.085,0.29) 119 [2,4.25) [4. 25,28. 5] 118 103 109 125 116 > credit$A1lcreditSA11summary(credit AL4) 0 132 60 120 35 220 200 35 400 9 96 160 34 340 80 30 360 100 30 380 280 40 176 112 350 180 18 140 16 108 240 14 132 4 272 320 14 144 300 13 232 4 460 260 420 480 168 560 52 152 440 4 20 520 128 150 92 312 164 110 330 181 129 352 216 130 370 32 102 73 228 21 75 136 396 43 290 145 399 154 500 49 141 210 225 17 62 163 252 720 86 93 121 156 167 170 174 178 (other NA s 72 13 >summary(creaitsALS) 500 10 20 1000 10 150 300 100 200 295 10 3000 400 560 600 2000 4000 5000 2 67 13 15 2 108 16 2 204 17 2 284 21 2 351 27 2 375 35 40 2 68 350 456 540 809 41 109 154 1200 1210 3065 12 59 122 173 14 23 80 134 195 25 87 140 32 70 130 184 98 105 112 113 120 126 141 146 147 158 160 162 168 179 196 (other) 141

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

Step: 3

blur-text-image

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

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions