For Analytic Solver, partition data sets into 50% training, 30% validation, and 20% test and use 12345 as the default random seed. If the predictor variable values are in the character format, th
For Analytic Solver, partition data sets into 50% training, 30% validation, and 20% test and use 12345 as the default random seed. If the predictor variable values are in the character format, then treat the predictor variable as a categorical variable. Otherwise, treat the predictor variable as a numerical variable.
The excel worksheet of the accompanying data file is used to classify individuals as likely or unlikely to attend church using five predictor variables: years of education (Educ), annual income (Income in $), age, sex (F = female, M = male), and marital status (Married, Y = yes, N = no). The outcome variable is Church (1 = attends, 0 otherwise). Create a classification tree model for predicting whether the individual is likely to attend church.
a-1. How many leaf nodes are in the best-pruned tree and minimum error tree?
a-2. Which of the following is NOT a rule that can be derived from the best-pruned tree?
multiple choice
- If age is greater than or equal to 34.5 then the individual is likely to go to church.
- If age is greater than or equal to 34.5 then the individual is not likely to go to church.
- If age is less than 34.5 then the individual is not likely to go to church.
- If age is greater than or equal to 34.5 , the income is greater than or equal to 10 , 600 , and the age is greater than or equal to 62.5 then the individual is likely to go to church.
b. What are the accuracy rate, sensitivity, specificity, and precision of the best-pruned tree on the test data?
Note: Round your answers to 2 decimal places.
c. Generate the ROC curve. What is the area under the ROC curve (or AUC value)?
Note: Round your answer to 4 decimal places.
d. Score the cases in the Church_Score worksheet using the best-pruned tree. What percentage of the individuals in the score data set are likely to go to church based on a cutoff probability value of 0.5?
Note: Round your answer to 2 decimal places.
Sheet1
Educ | Income | Age | Sex | Married | Church |
8 | 97700 | 71 | F | N | 1 |
18 | 3900 | 35 | F | Y | 1 |
15 | 124500 | 33 | M | Y | 0 |
15 | 57400 | 54 | F | Y | 1 |
15 | 108500 | 32 | M | Y | 0 |
18 | 95500 | 44 | F | Y | 1 |
20 | 120200 | 49 | M | N | 1 |
18 | 151300 | 45 | M | Y | 1 |
20 | 144400 | 66 | M | Y | 0 |
20 | 39400 | 57 | F | Y | 0 |
18 | 195600 | 43 | F | Y | 1 |
15 | 48800 | 37 | M | Y | 1 |
13 | 109800 | 50 | F | Y | 0 |
18 | 366400 | 46 | F | N | 1 |
20 | 110600 | 59 | F | Y | 0 |
18 | 46700 | 56 | F | Y | 1 |
15 | 273200 | 38 | F | Y | 0 |
18 | 154400 | 51 | M | Y | 1 |
15 | 138700 | 31 | M | Y | 0 |
18 | 132000 | 46 | F | Y | 1 |
8 | 57500 | 66 | F | N | 0 |
18 | 90100 | 37 | F | Y | 1 |
12 | 233500 | 43 | F | Y | 0 |
12 | 155000 | 36 | F | Y | 1 |
20 | 86100 | 60 | F | Y | 0 |
18 | 145600 | 37 | F | Y | 0 |
8 | 118500 | 48 | M | Y | 0 |
12 | 93200 | 34 | F | Y | 0 |
15 | 227400 | 36 | F | Y | 0 |
20 | 32300 | 53 | F | Y | 1 |
18 | 216400 | 40 | F | N | 1 |
18 | 61000 | 50 | F | N | 0 |
15 | 107000 | 30 | F | Y | 1 |
16 | 50200 | 59 | F | Y | 1 |
8 | 37200 | 57 | M | Y | 1 |
15 | 139400 | 36 | F | Y | 1 |
18 | 30500 | 45 | M | N | 1 |
8 | 257000 | 44 | M | Y | 0 |
15 | 132400 | 29 | F | Y | 0 |
16 | 62700 | 67 | F | Y | 0 |
20 | 40800 | 61 | F | N | 1 |
18 | 47600 | 40 | F | N | 1 |
20 | 126400 | 62 | M | Y | 0 |
16 | 215300 | 60 | M | Y | 1 |
18 | 59700 | 44 | M | N | 1 |
15 | 69400 | 42 | M | Y | 0 |
20 | 259700 | 42 | F | Y | 1 |
18 | 177100 | 53 | F | Y | 0 |
8 | 25600 | 43 | F | N | 0 |
20 | 5900 | 43 | F | Y | 0 |
20 | 128900 | 60 | F | N | 0 |
12 | 204600 | 45 | F | Y | 0 |
20 | 34800 | 46 | F | N | 0 |
20 | 26600 | 59 | F | Y | 1 |
15 | 167300 | 45 | F | Y | 1 |
18 | 115100 | 46 | F | N | 1 |
20 | 221500 | 52 | F | Y | 1 |
8 | 229800 | 44 | F | Y | 1 |
18 | 11300 | 45 | F | N | 1 |
20 | 221100 | 70 | F | Y | 0 |
12 | 190700 | 45 | F | Y | 1 |
15 | 80400 | 37 | F | Y | 0 |
15 | 68100 | 56 | F | Y | 0 |
15 | 84100 | 50 | F | Y | 1 |
18 | 541700 | 49 | F | Y | 1 |
18 | 485600 | 42 | F | N | 1 |
15 | 285100 | 35 | F | Y | 0 |
20 | 49200 | 71 | F | N | 0 |
15 | 297700 | 29 | F | Y | 0 |
20 | 212900 | 49 | F | Y | 0 |
20 | 76400 | 58 | F | N | 1 |
8 | 109800 | 56 | F | N | 1 |
20 | 105600 | 57 | F | Y | 1 |
15 | 154500 | 30 | M | Y | 0 |
15 | 513600 | 29 | F | Y | 0 |
10 | 157300 | 55 | M | Y | 0 |
16 | 182600 | 45 | M | Y | 0 |
20 | 64300 | 40 | F | N | 0 |
15 | 17700 | 60 | F | Y | 1 |
15 | 175600 | 35 | F | Y | 1 |
18 | 48600 | 55 | F | N | 1 |
20 | 30500 | 60 | F | N | 0 |
15 | 417200 | 33 | F | Y | 0 |
18 | 127500 | 37 | F | Y | 1 |
18 | 45400 | 48 | F | Y | 1 |
15 | 252200 | 34 | F | Y | 0 |
15 | 17300 | 36 | F | Y | 0 |
12 | 130800 | 43 | F | Y | 0 |
20 | 103700 | 60 | F | Y | 0 |
15 | 55400 | 40 | M | Y | 1 |
12 | 130700 | 44 | M | Y | 1 |
18 | 57200 | 53 | M | Y | 1 |
8 | 47400 | 49 | M | Y | 1 |
20 | 107700 | 62 | F | Y | 1 |
12 | 188300 | 32 | M | Y | 0 |
9 | 95500 | 35 | F | N | 0 |
18 | 44200 | 48 | F | N | 1 |
20 | 51500 | 54 | F | Y | 0 |
15 | 16800 | 49 | F | Y | 0 |
20 | 86400 | 48 | F | Y | 1 |
15 | 174500 | 34 | M | Y | 0 |
8 | 38500 | 41 | F | Y | 1 |
18 | 136600 | 46 | F | Y | 0 |
8 | 96400 | 32 | F | Y | 1 |
18 | 143300 | 49 | F | Y | 0 |
15 | 133600 | 41 | F | Y | 0 |
8 | 22300 | 66 | M | Y | 1 |
8 | 59600 | 38 | M | N | 1 |
18 | 125000 | 48 | F | Y | 1 |
18 | 20700 | 43 | F | Y | 0 |
20 | 45100 | 63 | F | N | 1 |
20 | 124300 | 67 | M | Y | 1 |
10 | 23800 | 54 | F | Y | 0 |
8 | 26000 | 41 | F | N | 1 |
20 | 113600 | 56 | M | N | 1 |
15 | 67100 | 43 | F | Y | 0 |
16 | 338500 | 56 | M | Y | 0 |
20 | 119000 | 63 | F | Y | 0 |