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
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 |
Step by Step Solution
3.36 Rating (149 Votes )
There are 3 Steps involved in it
Step: 1
a The accuracy specificity sensitivity and precision rates for the validation data set can be calculated using the confusion matrix The confusion matr...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