Question: 2 . 2 . sample run 3 What is the patient's ID: 2 0 0 Majority vote from 5 nearest neighbors: Positive Actually this patient
sample run
What is the patient's ID:
Majority vote from nearest neighbors: Positive
Actually this patient is tested: Negative. Step : Run over all patients and check the overall accuracy for mathrmk
Based on what you have in step you need to run a loop to check every patient's prediction vs actual diagnosis. Then find the accuracy total number of correct predictionstotal cases
# points for any given k for example k
# loop over all patients then find the accuracy Step : Find the best k
For different K this accuracy might not be the same. Find the best K which corresponds the highest accuracy.
: # points loop for different k: from to this loop will take minutes
# find the best k which corresponds the highest accuracy
Best k: The max. accuracy
plotting optional for you
: # points plotting plotting optional for you
points comparison: withwithout data scaling:
rerun your code if you skipped the step of data scaling in the beginning.
what are the differences?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
