The answers to this problem are based on R version 3.5.3. To replicate the results with newer
Question:
The answers to this problem are based on R version 3.5.3. To replicate the results with newer versions of R, execute the following line of code at the beginning of the R session or your R code: suppress Warnings (RNG version("3.5.3")). For R, partition data sets into 60% training and 40% validation. Use the statement set. seed(1) to specify the random seed of 1 for both data partitioning and cross-validation. 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 accompanying data set contains two predictor variables (x1, x2) and the target variable (y). Partition the data to develop a naïve Bayes classification model where ‘Y’ denotes the positive or success class for y.
a. Report the accuracy, specificity, sensitivity, and precision rates for the validation data set.
b-1. What is the area under the ROC curve (or the AUC value)?
b-2. Is the following statement a true statement? The ROC curve shows that the naïve Bayes model performs better than the baseline model in terms sensitivity and specificity across all possible cutoff values.
True
False
c. Report the scoring results for the five new observations.
|
y | x1 | x2 |
Y | A | 1 |
Y | B | 0 |
Y | C | 0 |
Y | B | 0 |
N | C | 0 |
N | A | 0 |
N | A | 1 |
N | A | 1 |
N | B | 1 |
Y | C | 0 |
N | B | 1 |
Y | C | 0 |
N | B | 1 |
Y | C | 0 |
N | A | 1 |
Y | C | 1 |
N | A | 1 |
Y | C | 0 |
N | C | 0 |
Y | C | 1 |
N | B | 1 |
N | B | 0 |
N | B | 1 |
Y | A | 0 |
Y | C | 1 |
Y | C | 0 |
N | C | 0 |
N | B | 1 |
N | B | 1 |
N | A | 0 |
Y | C | 0 |
N | B | 0 |
N | C | 1 |
Y | B | 1 |
Y | A | 0 |
Y | A | 1 |
N | B | 0 |
N | C | 1 |
Y | C | 0 |
N | B | 1 |
Y | B | 1 |
N | A | 1 |
Y | A | 1 |
N | A | 0 |
Y | A | 0 |
N | B | 0 |
N | B | 1 |
N | A | 1 |
Y | C | 0 |
Y | A | 0 |
N | B | 0 |
N | A | 0 |
Y | B | 1 |
Y | B | 1 |
Y | C | 1 |
Y | C | 0 |
Y | B | 0 |
N | A | 1 |
Y | A | 1 |
N | B | 0 |
N | C | 0 |
Y | A | 0 |
N | A | 1 |
N | C | 0 |
N | C | 1 |
Y | C | 1 |
Y | C | 0 |
Y | B | 0 |
N | B | 0 |
Y | C | 0 |
N | C | 0 |
Y | A | 0 |
N | C | 1 |
N | B | 0 |
N | C | 0 |
x1 | x2 |
A | 0 |
B | 1 |
C | 1 |
B | 0 |
C | 0 |
Managerial Accounting for Managers
ISBN: 978-0073527130
2nd edition
Authors: Eric Noreen, Peter Brewer, Ray Garrison