Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To replicate the KNN results in this exercise, it is essential that you use R version 4 . 2 . 1 or later and the

To replicate the KNN results in this exercise, it is essential that you use R version 4.2.1 or later and the latest version of theExercise_12.2
relevant packages. For consistency, the exercise uses the random number generator (RNG) algorithm from 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:
suppressWarnings(RNGversion("3.5.3")).
For R, partition the data sets into 60% training and 40% validation and implement the 10-fold cross-validation. Use the statement
set.seed(1) to specify the random seed for data partitioning and cross-validation. When searching for the optimal value of k, search
within possible k values from 1 to 10. 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 file contains 111 observations with the binary target variable y along with the predictor vales x1,x2,x3,
and x4
Click here for the Excel Data File
a. Perform KNN analysis on the data set. What is the optimal value of k? Enter the optimal k in the box below:
Optimal k
b-1. Report the accuracy, specificity, sensitivity, and precision rates for the validation data set.
Note: Round your answers to 2 decimal places.
b-2. Which of the following statements is most accurate?
A. The error rate of the KNN model is 66%.
B. The KNN model is able to correctly classify 64% of the Class 1 cases.
C. The KNN model is able to correctly classify 64% of the Class 0 cases.
D. Overall, the KNN model is able to correctly classify 73% of the cases.
c-1. What is the accuracy rate of the nave rule (classifying all cases into the predominant class) for the test data set? (In case of no
dominant class, choose class 1 as the dominant class.)
Note: Report your answer in percentage. Round your answer to 2 decimal places.
c-2. Is the ROC curve of the KNN model closer to the optimum (perfect) model or the baseline model?
Optimum (Perfect) model
O Baseline model
y x1 x2 x3 x4
174900869829886
160600849534603
152900659028107
044000659523583
154500689234086
145200618319156
140400628931564
151800748733821
144100809423415
038600568834566
151900548519647
047600819823518
035900437116575
048300699027080
152100859529678
042300629021713
044400658613902
050900699327652
161100679033742
032300719619414
140800638129864
048100749119466
143600608922787
044500839631898
042800729631810
137600578221558
034000377714398
038000478824266
139700578115403
043300639224402
152800829528155
145500679124246
050100839523162
143400408720967
140500718722231
048600789530720
037000588020252
050400769631958
135100548024423
045200759624614
149400799321531
048100679323921
140900498825316
136700468632534
143400759632636
051300689324893
046000417425613
141300578321546
142800649021127
135500417633074
042600598922473
044600739520675
050600387825918
138400618722275
139000628125539
040700588915685
150000749124730
043900709325936
145500679322204
135600417828458
176555347623111
156777543434545
132344345423565
134566656754344
144566344523456
154333547613735
1596008

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 Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

define technical writing?

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago