Question
Suppose you work for a wine company as a data mining expert. You are to build a k-nearest neighbor algorithm to predict the quality of
Suppose you work for a wine company as a data mining expert. You are to build a k-nearest neighbor algorithm to predict the quality of wine from different factors. Download the dataset calledwinequality-red.csv(Links to an external site.)
from Module 4 and then perform the following tasks. The data description is provided in the file calleddescription-winequality-red.docx(Links to an external site.)
.
- Provide the summary statistics for all the variables from the dataset. Explain some of the key aspects of the dataset.
- Examine the SAS code frommod4knn.sas(Links to an external site.)
- file and for each SAS statement, provide the explanation of the code as SAS comments. Put this part in the Appendix of your report.
- Perform the k-NN using k = 1, 2, and 3. For each case, explain the SAS output and give interpretation(s).
- Which case (k = 1, 2, or 3) provides the best model? Explain why using the output from part c.
Take the screenshots of SAS output and paste them into a Word document. Include all relevant calculations and your responses to all items (1, 2, 3, and 4) and submit the document to Canvas for grading. Clearly label all elements in your submission. In addition, provide a short description of any challenge(s) you faced during this
assignment.
MIS450MOD4kn.sas
/*Students need to modify this code accordingly*/ /*Randomly choose 50% of data to fit the model*/ proc surveyselect data=work.IMPORT3 out=wine samprate=0.5 method =srs outall; run; /*Number of k neighbors*/ %let k=1; /*Perform knn algorithm*/ proc discrim data=wine(where=(selected=1)) test=wine(where=(selected=0)) testout=winetestout method=NPAR k=&k listerr crosslisterr; class quality; var fixed_acidity volatile_acidity citric_acid residual_sugar chlorides free_sulfur_dioxide total_sulfur_dioxide density pH sulphates alcohol; title 'Using KNN on Wine Data'; run;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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