CMU 15-190 Spring 2017: Topics in Intermediate Programming
Homework 7 (Due Wednesday 29-Mar, at 11:59pm)
- This hw is optional. It is for students who want to get a bit more out of the optional/advanced talk last week, and in particular for those who may wish to get 3 units of pass/fail credit for 15-190 (for whom it is required). We hope that's quite a few of you!
- Work Solo or in Groups of 2-5 (and groups are strongly recommended) Have fun!
- We will grade the hw, but loosely, and chiefly based on effort. You should expect to invest 1-2 hours on it and you'll be fine. This is not about the grade, of course, but about the learning. So take your time, discuss issues with your groupmates, have fun, and enjoy.
- Please track when you start and stop working on this, and with whom you collaborate. You'll need that for your submission. And again, have fun.
- Short Answer
- Briefly explain how you would extend the code from lecture to recognize 1-9 instead of just "1" and "2".
- Explain one data based approach to choosing "k" in k-nearest-neighbors.
- Explain how to do k-nearest-neighbors if one of your input variables is categorical.
- Programming
You're working for mastercard and they've decided that they want to approve credit card applications automatically online. For each customer mastercard obtains a credit score and yearly income through an online form, and whether they have had a credit card before.
You've been tasked with building a classification algorithm for this approval process. Luckily, mastercard has previous applications for credit cards that you can use.
Ten of them are reproduced here:Credit score, had card before, income, approved 760, yes,100000, approved 770, yes,80000, approved 780, yes,75000, approved 700, yes, 30000, approved 600, no, 90000, approved 500, no,50000, not approved 400,no, 30000, not approved 700, no,10000, not approved 440, no,30000, not approved 800, yes,15000, approved
Use k-nearest-neighbors to predict whether the following 3 new applications will be approved for a credit card:760, yes, 100000 700, yes,800000 400, no, 50000
Include your code and the output for these 3 applications in your submission. Do not use any outside modules. Note that you will not need PCA here! - What to Submit
Each member of the group should submit their own PDF file, 15-190-hw7.pdf, containing this information:- Your name and andrew id
- The names and andrew id's of your groupmates
- The start/stop times you worked, and the total time you worked.
- Your thoughts about this exercise -- useful, interesting, etc? This will help us improve the 15-190 experience as we go.
- The solutions from above. Note: one way to create a PDF is to first make a Word file, then export that to PDF.
Have fun!