Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(PLS SHOW ME HOW IN EXCEL) Undecided Voters (k-NN classification).Campaign organizers for both the Repub-lican and Democratic parties are interested in identifying individual undecided voters

(PLS SHOW ME HOW IN EXCEL)

Undecided Voters (k-NN classification).Campaign organizers for both the Repub-lican and Democratic parties are interested in identifying individual undecided voters who would consider voting for their party in an upcoming election. A non-partisan group has collected data on a sample of voters with tracked variables, including whether or not they are undecided regarding their candidate preference, age, whether they own a home, gender, marital status, household size, income, years of education, and whether they attend church. Using Undecided as the target (or response) variable, construct a series of k-nearest neighbor classifiers as directed by the following parts (a), (b), and (c). Evaluate a range of values of k and standardize the input variables to adjust for the different magnitudes of the variables.

a.Use only the continuous variables (Age, HouseholdSize, Income, and Education) as input variables. For a default cutoff value of 0.5, what value of k minimizes the overall error rate on a static validation set or through a 10-fold cross-validation procedure?

image text in transcribed \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|} \hline Undecided & Age & HomeOwner & Female & Married & HouseholdSize & Income & Education & Church & Partition \\ \hline 1 & 51 & 1 & 1 & 1 & 4 & 171 & 15 & 0 & t \\ \hline 0 & 46 & 1 & 1 & 1 & 6 & 420 & 15 & 1 & t \\ \hline 1 & 55 & 1 & 0 & 1 & 6 & 132 & 16 & 0 & t \\ \hline 0 & 50 & 1 & 0 & 1 & 4 & 18 & 8 & 0 & t \\ \hline 1 & 49 & 1 & 1 & 1 & 2 & 66 & 15 & 1 & t \\ \hline 1 & 56 & 1 & 1 & 1 & 5 & 127 & 13 & 1 & t \\ \hline 1 & 30 & 1 & 1 & 1 & 7 & 79 & 15 & 1 & t \\ \hline 0 & 54 & 0 & 1 & 1 & 5 & 122 & 12 & 0 & t \\ \hline 0 & 45 & 1 & 1 & 1 & 5 & 83 & 18 & 1 & t \\ \hline 0 & 34 & 1 & 0 & 1 & 3 & 289 & 15 & 0 & t \\ \hline 1 & 41 & 1 & 0 & 0 & 4 & 74 & 15 & 0 & t \\ \hline 0 & 49 & 1 & 1 & 1 & 3 & 222 & 20 & 1 & t \\ \hline 1 & 56 & 1 & 0 & 1 & 3 & 73 & 16 & 0 & t \\ \hline 0 & 41 & 1 & 1 & 1 & 5 & 161 & 9 & 1 & . \\ \hline 0 & 59 & 1 & 1 & 1 & 4 & 71 & 20 & 1 & t \\ \hline 0 & 38 & 0 & 1 & 1 & 3 & 242 & 18 & 1 & t \\ \hline 0 & 52 & 1 & 0 & 1 & 3 & 276 & 15 & 0 & t \\ \hline 0 & 47 & 1 & 1 & 1 & 3 & 130 & 20 & 1 & t \\ \hline 1 & 57 & 1 & 1 & 1 & 2 & 94 & 15 & 0 & t \\ \hline 0 & 66 & 1 & 1 & 1 & 4 & 163 & 20 & 1 & . \\ \hline 1 & 54 & 1 & 1 & 1 & 5 & 99 & 18 & 0 & t \\ \hline 1 & 48 & 1 & 1 & 1 & 3 & 104 & 18 & 0 & t \\ \hline 0 & 63 & 1 & 1 & 0 & 3 & 174 & 20 & 1 & t \\ \hline 1 & 62 & 1 & 0 & 0 & 2 & 136 & 16 & 0 & t \\ \hline 0 & 37 & 1 & 0 & 1 & 2 & 198.5 & 9 & 1 & t \\ \hline 0 & 67 & 1 & 1 & 1 & 3 & 18 & 8 & 0 & . \\ \hline 1 & 54 & 1 & 1 & 0 & 1 & 53 & 20 & 0 & t \\ \hline 1 & 56 & 1 & 1 & 1 & 3 & 80 & 20 & 0 & t \\ \hline 1 & 51 & 1 & 1 & 1 & 3 & 53 & 16 & 0 & t \\ \hline 0 & 35 & 1 & 1 & 1 & 3 & 78 & 18 & 1 & t \\ \hline 1 & 38 & 1 & 1 & 0 & 3 & 40.5 & 15 & 0 & t \\ \hline 1 & 63 & 1 & 1 & 1 & 3 & 90 & 20 & 0 & t \\ \hline 1 & 52 & 0 & 1 & 0 & 4 & 53 & 16 & 1 & t \\ \hline \end{tabular}

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

Students also viewed these Accounting questions

Question

Is attachment to caretakers vital for further development?

Answered: 1 week ago

Question

=+What can we learn about the PVA data from this decision tree?

Answered: 1 week ago

Question

Identify how culture affects appropriate leadership behavior

Answered: 1 week ago